Increase the realloc increment from 128 to 1024.
The contents of the env_add array should not include the leading "env=" prefix.
This commit is contained in:
@@ -118,13 +118,13 @@ push(struct dynamic_array *arr, const char *entry)
|
||||
}
|
||||
|
||||
if (arr->len + (entry != NULL) >= arr->size) {
|
||||
char **tmp = reallocarray(arr->entries, arr->size + 128, sizeof(char *));
|
||||
char **tmp = reallocarray(arr->entries, arr->size + 1024, sizeof(char *));
|
||||
if (tmp == NULL) {
|
||||
free(copy);
|
||||
return false;
|
||||
}
|
||||
arr->entries = tmp;
|
||||
arr->size += 128;
|
||||
arr->size += 1024;
|
||||
}
|
||||
if (copy != NULL)
|
||||
arr->entries[arr->len++] = copy;
|
||||
@@ -372,6 +372,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
|
||||
/* Additional environment variables to add. */
|
||||
if (strncmp(line, "env=", sizeof("env=") - 1) == 0) {
|
||||
const char *cp = line + sizeof("env=") - 1;
|
||||
if (strchr(cp, '=') != NULL)
|
||||
push(&env_add, line);
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user