Bug 1646171 - Fix vsnprintf complaint in Assertions.cpp r=froydnj

For some reason, our clang-plugin didn't notice this before clang 11.

Differential Revision: https://phabricator.services.mozilla.com/D79901
This commit is contained in:
David Major 2020-06-16 21:26:16 +00:00
Родитель dd955b19e7
Коммит 0f1c6a1f28
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -5,6 +5,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/Atomics.h"
#include "mozilla/Sprintf.h"
#include <stdarg.h>
@ -34,8 +35,7 @@ MFBT_API MOZ_COLD MOZ_NEVER_INLINE MOZ_FORMAT_PRINTF(1, 2) const
}
va_list aArgs;
va_start(aArgs, aFormat);
int ret =
vsnprintf(sPrintfCrashReason, sPrintfCrashReasonSize, aFormat, aArgs);
int ret = VsprintfLiteral(sPrintfCrashReason, aFormat, aArgs);
va_end(aArgs);
MOZ_RELEASE_ASSERT(
ret >= 0 && size_t(ret) < sPrintfCrashReasonSize,