diff options
author | Max Moroz <mmoroz@chromium.org> | 2019-05-31 20:47:11 -0700 |
---|---|---|
committer | Max Moroz <mmoroz@chromium.org> | 2019-05-31 20:47:11 -0700 |
commit | ecf68cf70b9eeadd075c06eebc29979fb0586130 (patch) | |
tree | 7908d7c5038d27911456fd6c4875312a88fae11d | |
parent | 230751d78eaa74518d48e0c6e0e5003a68e2e7e7 (diff) |
[njs] Null terminate the script string.
-rw-r--r-- | projects/njs/njs_process_script_fuzzer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/projects/njs/njs_process_script_fuzzer.c b/projects/njs/njs_process_script_fuzzer.c index b90425d9..1a1ac0f7 100644 --- a/projects/njs/njs_process_script_fuzzer.c +++ b/projects/njs/njs_process_script_fuzzer.c @@ -674,8 +674,9 @@ lvlhsh_pool_free(void *pool, void *p, size_t size) int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size == 0) return 0; - char* input = malloc(size); + char* input = malloc(size + 1); memcpy(input, data, size); + input[size] = 0; nxt_str_t line = {size, input}; njs_vm_t *vm; |