Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 8837679 Details for
Bug 1321814
[patch]
esr45 version of Abort if callback backup path truncated
trunc4-esr45.diff (text/plain), 1.80 KB, created by
Adam Gashlin (he/him) [:agashlin] (ex-moco)
(
hide
)
Description:
esr45 version of Abort if callback backup path truncated
Filename:
MIME Type:
Creator:
Adam Gashlin (he/him) [:agashlin] (ex-moco)
Size:
1.80 KB
patch
obsolete
>diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp >--- a/toolkit/mozapps/update/updater/updater.cpp >+++ b/toolkit/mozapps/update/updater/updater.cpp >@@ -3330,20 +3330,35 @@ int NS_main(int argc, NS_tchar **argv) > else > *d = *s; > ++s; > ++d; > } while (*s); > *d = NS_T('\0'); > ++d; > >+ const size_t callbackBackupPathBufSize = >+ sizeof(gCallbackBackupPath)/sizeof(gCallbackBackupPath[0]); >+ const int callbackBackupPathLen = >+ NS_tsnprintf(gCallbackBackupPath, callbackBackupPathBufSize, >+ NS_T("%s" CALLBACK_BACKUP_EXT), argv[callbackIndex]); >+ >+ if (callbackBackupPathLen < 0 || >+ callbackBackupPathLen >= static_cast<int>(callbackBackupPathBufSize)) { >+ LOG(("NS_main: callback backup path truncated")); >+ LogFinish(); >+ WriteStatusFile(USAGE_ERROR); >+ >+ // Don't attempt to launch the callback when the callback path is >+ // longer than expected. >+ EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 1); >+ return 1; >+ } >+ > // Make a copy of the callback executable so it can be read when patching. >- NS_tsnprintf(gCallbackBackupPath, >- sizeof(gCallbackBackupPath)/sizeof(gCallbackBackupPath[0]), >- NS_T("%s" CALLBACK_BACKUP_EXT), argv[callbackIndex]); > NS_tremove(gCallbackBackupPath); > CopyFileW(argv[callbackIndex], gCallbackBackupPath, false); > > // Since the process may be signaled as exited by WaitForSingleObject before > // the release of the executable image try to lock the main executable file > // multiple times before giving up. If we end up giving up, we won't > // fail the update. > const int max_retries = 10;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
molly
: review+
gchang
: approval-mozilla-esr45+
Actions:
View
|
Diff
|
Review
Attachments on
bug 1321814
:
8816459
|
8826427
|
8826808
|
8828571
|
8837674
|
8837675
| 8837679