]> git.kaiwu.me - quickjs.git/commit
Prevent UB on memcpy and floating point conversions
authorCharlie Gordon <github@chqrlie.org>
Sun, 3 Mar 2024 13:05:40 +0000 (14:05 +0100)
committerCharlie Gordon <github@chqrlie.org>
Sun, 3 Mar 2024 13:05:40 +0000 (14:05 +0100)
commit06c100c9bfeef0d0c1d138153321491f7884cef3
tree6987131831e232535b359e97b0cee295b8ee65a5
parent3dd93eb4e4b82ded4570a6baaf0a6418507144b7
Prevent UB on memcpy and floating point conversions

- add `memcpy_no_ub` that accepts null pointers for 0 count
- prevent 0 length allocation in `js_worker_postMessage`
- use safer test for `int` value in `JS_NewFloat64`,
  `JS_ToArrayLengthFree` and `js_typed_array_indexOf`
cutils.c
cutils.h
libbf.c
quickjs.c
quickjs.h