mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
850869a8df
If someone tried to serialize a zero-size ByteBuf, it could add a zero-length segment to the `BufferList` and cause an assertion failure later when trying to send the message. This patch makes it a no-op (and frees the supplied buffer, because the BufferList becomes its owner). We previously asserted against adding zero-*capacity* segments (likely also zero size, but possibly not) with WriteBytesZeroCopy, but only on debug builds, and it was likely happening on release builds despite that. That case is now allowed. Also, error handling for `BufferList::WriteBytesZeroCopy` has been improved. (This doesn't affect `Pickle` because it's using infallible allocation, and no other instances of `BufferList` seem to use `WriteBytesZeroCopy` at this time.) Differential Revision: https://phabricator.services.mozilla.com/D192531 |
||
---|---|---|
.. | ||
app | ||
chromium | ||
contentproc | ||
docs | ||
glue | ||
gtest | ||
ipdl | ||
mscom | ||
testshell | ||
moz.build | ||
pull-chromium.py |