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
Родитель 232e9231e5
Коммит 2d1ae94059
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -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",