Bug 507569: Fix possible crash in nsStandardURL::SegmentIs() (Coverity) r=bz

This commit is contained in:
Randell Jesup 2011-05-27 01:44:15 -04:00
parent 5ab4d1baa7
commit b23a547d6a

View File

@ -710,6 +710,8 @@ nsStandardURL::SegmentIs(const URLSegment &seg1, const char *val, const URLSegme
return PR_FALSE;
if (seg1.mLen == -1 || (!val && mSpec.IsEmpty()))
return PR_TRUE; // both are empty
if (!val)
return PR_FALSE;
if (ignoreCase)
return !PL_strncasecmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen);
else