Fix previous rev.: don't step behind the end of memory we allocate
This commit is contained in:
parent
8cefd1665a
commit
4c4dfdea1b
@ -178,7 +178,7 @@ main(int argc, char **argv)
|
|||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
if (AddMode != SLAVE) {
|
if (AddMode != SLAVE) {
|
||||||
pkgs = (char **)malloc(argc * sizeof(char *));
|
pkgs = (char **)malloc((argc+1) * sizeof(char *));
|
||||||
for (ch = 0; ch <= argc; pkgs[ch++] = NULL) ;
|
for (ch = 0; ch <= argc; pkgs[ch++] = NULL) ;
|
||||||
|
|
||||||
/* Get all the remaining package names, if any */
|
/* Get all the remaining package names, if any */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user