Bug 1344921 relocate initialization (and declaration) of variable to not allow a jump to bypass it
MozReview-Commit-ID: LouiRkuCAqb
--- a/mozglue/build/WindowsDllBlocklist.cpp
+++ b/mozglue/build/WindowsDllBlocklist.cpp
@@ -530,16 +530,18 @@ patched_LdrLoadDll (PWCHAR filePath, PUL
char dllName[DLLNAME_MAX+1];
wchar_t *dll_part;
char *dot;
int len = moduleFileName->Length / 2;
wchar_t *fname = moduleFileName->Buffer;
UniquePtr<wchar_t[]> full_fname;
+ const DllBlockInfo* info = &sWindowsDllBlocklist[0];
+
// The filename isn't guaranteed to be null terminated, but in practice
// it always will be; ensure that this is so, and bail if not.
// This is done instead of the more robust approach because of bug 527122,
// where lots of weird things were happening when we tried to make a copy.
if (moduleFileName->MaximumLength < moduleFileName->Length+2 ||
fname[len] != 0)
{
#ifdef DEBUG
@@ -610,17 +612,16 @@ patched_LdrLoadDll (PWCHAR filePath, PUL
current++;
}
if (current == dot) {
return STATUS_DLL_NOT_FOUND;
}
}
// then compare to everything on the blocklist
- const DllBlockInfo* info = &sWindowsDllBlocklist[0];
while (info->name) {
if (strcmp(info->name, dllName) == 0)
break;
info++;
}
if (info->name) {