Bug 1619260 - Prevent assertion when processing nsStringBuffer leaks. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D64949

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Simon Giesecke 2020-03-02 14:31:09 +00:00
parent 232e9231e5
commit 2d1ae94059

View File

@ -331,8 +331,7 @@ static void DumpSerialNumbers(const SerialHash::Iterator& aHashEntry, FILE* aFd,
// This output will be wrong if the nsStringBuffer was used to
// store a char16_t string.
auto* buffer = static_cast<const nsStringBuffer*>(aHashEntry.Key());
nsDependentCString bufferString(static_cast<char*>(buffer->Data()),
buffer->StorageSize() - 1);
nsDependentCString bufferString(static_cast<char*>(buffer->Data()));
fprintf(outputFile,
"Contents of leaked nsStringBuffer with storage size %d as a "
"char*: %s\n",