Skip to content

Commit

Permalink
do not perform arithmetic on nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed Sep 19, 2023
1 parent 7be27dc commit 0234a41
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 0234a41

Please sign in to comment.