mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00
Bug 1646206 - Fix a vsnprintf lint in ClearKeyUtils.cpp r=bryce
We have a clang-plugin check that discourages raw `vsnprintf`, but for some reason it doesn't catch this before clang 11. I _think_ it's related to earlier versions not being able to see that `len` is a constant, but I'm not really sure. Differential Revision: https://phabricator.services.mozilla.com/D79918
This commit is contained in:
parent
67acf10354
commit
dd955b19e7
@ -36,6 +36,7 @@
|
||||
#include "ArrayUtils.h"
|
||||
#include "BigEndian.h"
|
||||
#include "ClearKeyBase64.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "pk11pub.h"
|
||||
#include "prerror.h"
|
||||
#include "psshparser/PsshParser.h"
|
||||
@ -74,7 +75,7 @@ void CK_Log(const char* aFmt, ...) {
|
||||
va_start(ap, aFmt);
|
||||
const size_t len = 1024;
|
||||
char buf[len];
|
||||
vsnprintf(buf, len, aFmt, ap);
|
||||
VsprintfLiteral(buf, aFmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
fprintf(out, "%s\n", buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user