projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55b2ded
)
Fix create list segfault
author
Glenn L McGrath
<bug1@ihug.co.nz>
Sat, 3 Nov 2001 08:29:35 +0000
(08:29 -0000)
committer
Glenn L McGrath
<bug1@ihug.co.nz>
Sat, 3 Nov 2001 08:29:35 +0000
(08:29 -0000)
archival/dpkg.c
patch
|
blob
|
history
diff --git
a/archival/dpkg.c
b/archival/dpkg.c
index ec199a72cf0850b07b37b2e43600edfb25a33dfd..88cf8b8724902ac0d5f72f7154477ba137716894 100644
(file)
--- a/
archival/dpkg.c
+++ b/
archival/dpkg.c
@@
-1041,7
+1041,8
@@
char **create_list(const char *filename)
return(file_list);
}
while (getline(&line, &length, list_stream) != -1) {
- file_list = xrealloc(file_list, sizeof(char *) * (length + 1));
+ /* +2 as we need to include space for the terminating NULL pointer */
+ file_list = xrealloc(file_list, sizeof(char *) * (length + 2));
last_char = last_char_is(line, '\n');
if (last_char) {
*last_char = '\0';