From f09d24441f30fc2690330e0f93dd2d5a158b5ddb Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Wed, 17 Oct 2012 10:44:31 -0400 Subject: [PATCH] Bug 801780 - Part 1: Escape quotes in memory reporter paths when dumping to JSON. r=njn --- xpcom/base/MemoryInfoDumper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xpcom/base/MemoryInfoDumper.cpp b/xpcom/base/MemoryInfoDumper.cpp index 2e8c148c57ee..fb34b08a717c 100644 --- a/xpcom/base/MemoryInfoDumper.cpp +++ b/xpcom/base/MemoryInfoDumper.cpp @@ -399,7 +399,8 @@ DumpReport(nsIGZFileWriter *aWriter, bool aIsFirst, DUMP(aWriter, "\", \"path\": \""); nsCString path(aPath); - path.ReplaceSubstring("\\", "\\\\"); // escape backslashes for JSON + path.ReplaceSubstring("\\", "\\\\"); /* --> \\ */ + path.ReplaceSubstring("\"", "\\\""); // " --> \" DUMP(aWriter, path); DUMP(aWriter, "\", \"kind\": ");