Skip to content

Commit 1f8c677

Browse files
committed
Fix bytecode memcpy() zero-size NULL pointer
1 parent 3484636 commit 1f8c677

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src-input/duk_api_bytecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
540540
DUK_ASSERT((count_const == 0 && count_funcs == 0) || tv1 != NULL);
541541

542542
q = fun_data;
543-
duk_memcpy((void *) q, (const void *) tv1, sizeof(duk_tval) * count_const);
543+
duk_memcpy_unsafe((void *) q, (const void *) tv1, sizeof(duk_tval) * count_const);
544544
for (n = count_const; n > 0; n--) {
545545
DUK_TVAL_INCREF_FAST(thr, (duk_tval *) (void *) q); /* no side effects */
546546
q += sizeof(duk_tval);

0 commit comments

Comments
 (0)