mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 12:44:33 +02:00
Merge branch 'bugfix/partition_remove_strlcpy' into 'master'
partition: Replace strlcpy() with strncpy() See merge request espressif/esp-idf!13603
This commit is contained in:
@@ -235,8 +235,8 @@ static esp_err_t load_partitions(void)
|
|||||||
item->info.encrypted = true;
|
item->info.encrypted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: if label in flash is not null terminated, one byte will be truncated here
|
// item->info.label is initialized by calloc, so resulting string will be null terminated
|
||||||
strlcpy(item->info.label, (const char*) entry.label, sizeof(item->info.label));
|
strncpy(item->info.label, (const char*) entry.label, sizeof(item->info.label) - 1);
|
||||||
|
|
||||||
// add it to the list
|
// add it to the list
|
||||||
if (last == NULL) {
|
if (last == NULL) {
|
||||||
|
Reference in New Issue
Block a user