From 0b78a933bf159e414e4e357d72be2685f4e9dc9d Mon Sep 17 00:00:00 2001 From: "edward.lee%engineering.uiuc.edu" Date: Sat, 3 Nov 2007 17:47:20 +0000 Subject: [PATCH] Bug 402298 - Random base64 file names can contain '/'. r=jst, sr=jst, b1.9=mconnor, a=blockingM9 git-svn-id: svn://10.0.0.236/trunk@238476 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp index 1c60cb4eee4..dcedb345908 100644 --- a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1175,6 +1175,10 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel) PR_Free(b64); b64 = nsnull; + // Base64 characters are alphanumeric (a-zA-Z0-9) and '+' and '/', so we need + // to replace illegal characters -- notably '/' + tempLeafName.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS, '_'); + // now append our extension. nsCAutoString ext; mMimeInfo->GetPrimaryExtension(ext);