Bug 1125865: Only log Windows sandbox violations to console when nsContentUtils is initialized. r=bbondy
--- a/security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
+++ b/security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
@@ -98,17 +98,19 @@ Log(const char* aMessageType,
std::string msg = msgStream.str();
#if defined(DEBUG)
// Use NS_DebugBreak directly as we want child process prefix, but not source
// file or line number.
NS_DebugBreak(NS_DEBUG_WARNING, nullptr, msg.c_str(), nullptr, -1);
#endif
- nsContentUtils::LogMessageToConsole(msg.c_str());
+ if (nsContentUtils::IsInitialized()) {
+ nsContentUtils::LogMessageToConsole(msg.c_str());
+ }
}
// Initialize sandbox logging if required.
static void
InitLoggingIfRequired()
{
if (!sProvideLogFunctionCb) {
return;