From bf4cf0d5dd23bc2f7ded3634679ee1364b61a2f7 Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Fri, 23 Apr 1999 21:32:57 +0000 Subject: [PATCH] Bug #4184. Before unescaping a path, call ReAllocData. --- base/src/nsFileSpec.cpp | 3 +++ xpcom/io/nsFileSpec.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/base/src/nsFileSpec.cpp b/base/src/nsFileSpec.cpp index 4f6ec18a7fa..2813d6f579a 100644 --- a/base/src/nsFileSpec.cpp +++ b/base/src/nsFileSpec.cpp @@ -173,6 +173,9 @@ void nsSimpleCharString::SetToEmpty() void nsSimpleCharString::Unescape() //---------------------------------------------------------------------------------------- { + if (!mData) + return; + ReallocData(mData->mLength); if (!mData) return; nsUnescape(mData->mString); diff --git a/xpcom/io/nsFileSpec.cpp b/xpcom/io/nsFileSpec.cpp index 4f6ec18a7fa..2813d6f579a 100644 --- a/xpcom/io/nsFileSpec.cpp +++ b/xpcom/io/nsFileSpec.cpp @@ -173,6 +173,9 @@ void nsSimpleCharString::SetToEmpty() void nsSimpleCharString::Unescape() //---------------------------------------------------------------------------------------- { + if (!mData) + return; + ReallocData(mData->mLength); if (!mData) return; nsUnescape(mData->mString);