Bug 788884 - Fix compiler warning and potential integer underflow [r=bsmedberg]

This commit is contained in:
Thomas Zimmermann 2012-09-05 16:52:54 -07:00
parent da63f78ed6
commit 80a1c43a2c

View File

@ -164,7 +164,7 @@ int main(int argc, char* argv[])
}
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
if (!lastSlash || ((lastSlash - exePath) + sizeof(XPCOM_DLL) + 1 > MAXPATHLEN))
return 255;
strcpy(++lastSlash, XPCOM_DLL);