quickjs-ng / quickjs

QuickJS, the Next Generation: a mighty JavaScript engine
MIT License
691 stars 66 forks source link

fix crash in js_typed_array_slice caused by memory overlap #379

Closed BambooLqq closed 2 months ago

BambooLqq commented 2 months ago

Use memmove instead of memcpy for safe.

Fixes: https://github.com/quickjs-ng/quickjs/issues/378

saghul commented 2 months ago

Cn you add a test please?

BambooLqq commented 2 months ago

Cn you add a test please?

Ok, I added the test in test_builtin.js.

saghul commented 2 months ago

Excellent!