Skip to content

Buffers written to via Bluetooth with shorter messages then past content sometimes have past content in them #114

@drawnto

Description

@drawnto

When i played around with (c) v0.1-23-gc64530 last time i noticed that when writing buffers such as BLE device name and if i recall correctly also the flash_splash_screen do not clear out the past buffers content.

This is relevant when using a shorter BLE device name or an image smaller than the initial flash screen. It is not documented that non-overwritten bytes remain.

This matches the source code

static void cfg_ble_devname(uint8_t *name, uint16_t len)
{
	tmos_memcpy(badge_cfg.ble_devname, name, len);
}

which only overwrites the part of the string which are passed in but the rest is cleared.

If the string needs to be null-terminated that is not checked and not documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions