mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Do not copy more bytes than the filename string contains.
This commit is contained in:
parent
fd3078d6bb
commit
7004355c0f
@ -651,7 +651,7 @@ reserve(const char *name, coffee_page_t pages,
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(&hdr, 0, sizeof(hdr));
|
memset(&hdr, 0, sizeof(hdr));
|
||||||
memcpy(hdr.name, name, sizeof(hdr.name) - 1);
|
strncpy(hdr.name, name, sizeof(hdr.name) - 1);
|
||||||
hdr.max_pages = pages;
|
hdr.max_pages = pages;
|
||||||
hdr.flags = HDR_FLAG_ALLOCATED | flags;
|
hdr.flags = HDR_FLAG_ALLOCATED | flags;
|
||||||
write_header(&hdr, page);
|
write_header(&hdr, page);
|
||||||
|
Loading…
Reference in New Issue
Block a user