From fa9f41637c1c6cee16ffece9394d1e20f7fa08cb Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Mon, 27 Feb 2006 19:44:48 +0000 Subject: [PATCH] Don't allocate a buffer when assigning a zero-length string, just call Truncate() instead (bug 328755). r=darin. git-svn-id: svn://10.0.0.236/trunk@191323 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/string/src/nsTSubstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mozilla/xpcom/string/src/nsTSubstring.cpp b/mozilla/xpcom/string/src/nsTSubstring.cpp index 2f3cbe06cf7..20046c57f45 100644 --- a/mozilla/xpcom/string/src/nsTSubstring.cpp +++ b/mozilla/xpcom/string/src/nsTSubstring.cpp @@ -299,7 +299,7 @@ void nsTSubstring_CharT::Assign( const char_type* data, size_type length ) { // unfortunately, some callers pass null :-( - if (!data) + if (!data || length == 0) { Truncate(); return;