[njs] Null terminate the script string.

This commit is contained in:
Max Moroz 2019-05-31 20:47:11 -07:00
parent 230751d78e
commit ecf68cf70b
1 changed files with 2 additions and 1 deletions

View File

@ -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;