Skip to content

Commit

Permalink
Ubsan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed May 12, 2024
1 parent 9bb4240 commit 1e9f708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/curlrequester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ size_t CurlIppPosterBase::requestWrite(char* dest, size_t size)
else // No compression = memcpy
{
bytesWritten = std::min(size, remaining);
_data.getBytes(dest, bytesWritten);
if(bytesWritten != 0) // Please the ubsan
{
_data.getBytes(dest, bytesWritten);
}
}

if(!_done)
Expand Down
2 changes: 1 addition & 1 deletion utils/ippclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int main(int argc, char** argv)
int rightMargin;

bool antiAlias;
bool save;
bool save = false;

int id;

Expand Down

0 comments on commit 1e9f708

Please sign in to comment.