btrev43152 adds 1 changeset to branch 'master'
old head: 86f02e2a45ee46f45e674f56e6147e4245172662
new head: 18e01e2af6dd1a4145d91f47cc1d658a36b0bd56
overview:
https://git.haiku-os.org/buildtools/log/?qt=range&q=18e01e2af6dd+%5E86f02e2a45ee
----------------------------------------------------------------------------
18e01e2af6dd: 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@xxxxxxxxx>
[ Simon South <simon@xxxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: btrev43152
Commit: 18e01e2af6dd1a4145d91f47cc1d658a36b0bd56
URL: https://git.haiku-os.org/buildtools/commit/?id=18e01e2af6dd
Author: Simon South <simon@xxxxxxxxxxxxxx>
Date: Tue Aug 13 20:04:36 2019 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Tue Aug 13 20:22:35 2019 UTC
Ticket: https://dev.haiku-os.org/ticket/15250
----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 1 deletion(-)
jam/jcache.c | 4 +++-
----------------------------------------------------------------------------
diff --git a/jam/jcache.c b/jam/jcache.c
index c50fc0f13e..47e471a6a6 100644
--- a/jam/jcache.c
+++ b/jam/jcache.c
@@ -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;
}