src: guard against overflow in ParseArrayIndex() · nodejs/node@f3e5b39 · GitHub
Skip to content

Commit f3e5b39

Browse files
bnoordhuiscjihrig
authored andcommitted
src: guard against overflow in ParseArrayIndex()
ParseArrayIndex() would wrap around large (>=2^32) index values on platforms where sizeof(int64_t) > sizeof(size_t). Ensure that the return value fits in a size_t. PR-URL: #7497 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c730a5d commit f3e5b39

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/node_buffer.cc

Lines changed: 5 additions & 0 deletions

test/parallel/test-buffer-alloc.js

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)