mirror of https://github.com/google/oss-fuzz.git
[njs] Null terminate the script string.
This commit is contained in:
parent
230751d78e
commit
ecf68cf70b
|
@ -674,8 +674,9 @@ lvlhsh_pool_free(void *pool, void *p, size_t size)
|
||||||
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||||
if (size == 0) return 0;
|
if (size == 0) return 0;
|
||||||
|
|
||||||
char* input = malloc(size);
|
char* input = malloc(size + 1);
|
||||||
memcpy(input, data, size);
|
memcpy(input, data, size);
|
||||||
|
input[size] = 0;
|
||||||
nxt_str_t line = {size, input};
|
nxt_str_t line = {size, input};
|
||||||
|
|
||||||
njs_vm_t *vm;
|
njs_vm_t *vm;
|
||||||
|
|
Loading…
Reference in New Issue