Fix previous rev.: don't step behind the end of memory we allocate

This commit is contained in:
Pav Lucistnik 2007-02-01 15:52:47 +00:00
parent 7404bf519f
commit 103fcbb3ba

View File

@ -178,7 +178,7 @@ main(int argc, char **argv)
argv += optind;
if (AddMode != SLAVE) {
pkgs = (char **)malloc(argc * sizeof(char *));
pkgs = (char **)malloc((argc+1) * sizeof(char *));
for (ch = 0; ch <= argc; pkgs[ch++] = NULL) ;
/* Get all the remaining package names, if any */