Fixed null pointer ASAN error introduced in commit d41b7c23

Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
This commit is contained in:
AeroStun
2019-10-06 20:23:25 +02:00
committed by Vinnie Falco
parent 37f75773ef
commit da3b5a664c
2 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
Version 272: Version 272:
* Add BEAST_THROWS * Add BEAST_THROWS
* Add zlib tests and fixes
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -467,7 +467,7 @@ doWrite(z_params& zs, boost::optional<Flush> flush, error_code& ec)
else if(flush != Flush::block) else if(flush != Flush::block)
{ {
/* FULL_FLUSH or SYNC_FLUSH */ /* FULL_FLUSH or SYNC_FLUSH */
tr_stored_block((char*)0, 0L, 0); tr_stored_block(nullptr, 0L, 0);
/* For a full flush, this empty block will be recognized /* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync(). * as a special marker by inflate_sync().
*/ */
@@ -1298,7 +1298,8 @@ copy_block(
put_short((std::uint16_t)len); put_short((std::uint16_t)len);
put_short((std::uint16_t)~len); put_short((std::uint16_t)~len);
} }
std::memcpy(&pending_buf_[pending_], buf, len); if(buf)
std::memcpy(&pending_buf_[pending_], buf, len);
pending_ += len; pending_ += len;
} }