Skip to content

Commit

Permalink
Merge pull request #1654 from AntelopeIO/no_nullptr_arith
Browse files Browse the repository at this point in the history
do not perform arithmetic on `nullptr` inside WAVM serialization
  • Loading branch information
spoonincode authored Sep 19, 2023
2 parents 9ae4492 + 0234a41 commit 01b128e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/wasm-jit/Include/Inline/Serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Serialization
// Advances the stream cursor by numBytes, and returns a pointer to the previous stream cursor.
inline U8* advance(Uptr numBytes)
{
if(next + numBytes > end) { extendBuffer(numBytes); }
if(next == nullptr || next + numBytes > end) { extendBuffer(numBytes); }
WAVM_ASSERT_THROW(next + numBytes <= end);

U8* data = next;
Expand Down

0 comments on commit 01b128e

Please sign in to comment.