Don't pass a truncated argument buffer array to a handler function.

This commit is contained in:
W. Eric Norum
2001-03-15 22:09:36 +00:00
parent 3e485fd56f
commit 9b401acc13
+2 -4
View File
@@ -429,9 +429,7 @@ ioccrf (const char *pathname)
pioccrfFuncDef = found->pFuncDef;
/*
* Process arguments
* Must make local copy of pioccrfFuncDef->arg[arg] to
* ensure that this routine is thread-safe.
* Process arguments and call function
*/
for (int arg = 0 ; ; arg++) {
char *p = (arg < argc) ? argv[arg+1] : NULL;
@@ -448,7 +446,7 @@ ioccrf (const char *pathname)
if (np == NULL) {
fprintf (stderr, "Out of memory!\n");
argBufCapacity -= 20;
continue;
break;
}
argBuf = (ioccrfArgBuf *)np;
}