Skip to content

Commit

Permalink
fix UBSan runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
moz-mdauer committed Nov 2, 2024
1 parent f157745 commit 9461c91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzzing-headers/include/fuzzing/datasource/datasource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ void Datasource::put(const void* p, const size_t size, const uint64_t id) {
memcpy(out.data() + oldSize, &_size, sizeof(_size));
}

if ( size == 0 ) {
return;
}

{
const auto oldSize = out.size();
out.resize(oldSize + size);
Expand Down

0 comments on commit 9461c91

Please sign in to comment.