Bug 1229804: Use the correct string length in Windows sandbox logging. r=tabraldes

This commit is contained in:
Bob Owen 2015-12-03 11:19:14 +00:00
parent 9fd7a64540
commit 744f82da14
2 changed files with 6 additions and 6 deletions

View File

@ -61,12 +61,12 @@ LogBlocked(const char* aFunctionName, const wchar_t* aContext)
void
LogBlocked(const char* aFunctionName, const wchar_t* aContext,
uint16_t aLength)
uint16_t aLengthInBytes)
{
if (sLogFunction) {
// Skip an extra frame to allow for this function.
LogBlocked(aFunctionName,
base::WideToUTF8(std::wstring(aContext, aLength)).c_str(),
base::WideToUTF8(std::wstring(aContext, aLengthInBytes / sizeof(wchar_t))).c_str(),
/* aFramesToSkip */ 3);
}
}
@ -90,11 +90,11 @@ LogAllowed(const char* aFunctionName, const wchar_t* aContext)
void
LogAllowed(const char* aFunctionName, const wchar_t* aContext,
uint16_t aLength)
uint16_t aLengthInBytes)
{
if (sLogFunction) {
LogAllowed(aFunctionName,
base::WideToUTF8(std::wstring(aContext, aLength)).c_str());
base::WideToUTF8(std::wstring(aContext, aLengthInBytes / sizeof(wchar_t))).c_str());
}
}

View File

@ -43,7 +43,7 @@ void LogBlocked(const char* aFunctionName, const char* aContext = nullptr,
// Convenience functions to convert to char*.
void LogBlocked(const char* aFunctionName, const wchar_t* aContext);
void LogBlocked(const char* aFunctionName, const wchar_t* aContext,
uint16_t aLength);
uint16_t aLengthInBytes);
// Log a "ALLOWED" msg to the browser console and, if DEBUG build, stderr.
void LogAllowed(const char* aFunctionName, const char* aContext = nullptr);
@ -51,7 +51,7 @@ void LogAllowed(const char* aFunctionName, const char* aContext = nullptr);
// Convenience functions to convert to char*.
void LogAllowed(const char* aFunctionName, const wchar_t* aContext);
void LogAllowed(const char* aFunctionName, const wchar_t* aContext,
uint16_t aLength);
uint16_t aLengthInBytes);
} // sandboxing