mirror of
https://review.haiku-os.org/buildtools
synced 2024-11-23 07:18:49 +01:00
jam: jcache: Accept empty input files
Make new_string_list() initialize the buffer it creates to hold a file's contents, preventing a segfault later on should jam attempt to parse the contents of an empty file. Fixes #15250. Change-Id: I907dccd26e1ca35fbe07ed6d624b0144487134fe Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1716 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
86f02e2a45
commit
18e01e2af6
@ -112,7 +112,9 @@ new_string_list(int block_size)
|
||||
if (block_size <= 0)
|
||||
block_size = 5;
|
||||
list->block_size = block_size;
|
||||
if (!resize_string_list(list, 0)) {
|
||||
if (resize_string_list(list, 0))
|
||||
*list->strings = 0;
|
||||
else {
|
||||
free(list);
|
||||
list = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user