src: fix out-of-bounds check of serialization indices · nodejs/node@b4d2454 · GitHub
Skip to content

Commit b4d2454

Browse files
JoostKdanielleadams
authored andcommitted
src: fix out-of-bounds check of serialization indices
The usage of `CHECK_LE` to verify that the index is within bounds of a vector's size allows for reading one item past the vector's end, which is in invalid memory read. This commit fixes the off-by-one error by changing the bounds check to use `CHECK_LT`. PR-URL: #41452 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent d445816 commit b4d2454

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/node_messaging.cc

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)