Closed Bug 620405 Opened 9 years ago Closed 4 years ago

crash [@ nsStandardURL::SegmentIs] if !val && !mSpec.IsEmpty()

Categories

(Core :: Networking, defect, critical)

defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, crash, Whiteboard: [necko-backlog])

Crash Data

Attachments

(1 file)

708 PRBool
709 nsStandardURL::SegmentIs(const URLSegment &seg1, const char *val, const URLSegment &seg2, PRBool ignoreCase)
710 {
711     if (seg1.mLen != seg2.mLen)
712         return PR_FALSE;
this is the wrong set of tests:
713     if (seg1.mLen == -1 || (!val && mSpec.IsEmpty()))
714         return PR_TRUE; // both are empty
715     if (ignoreCase)
716         return !PL_strncasecmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen); 
717     else
718         return !strncmp(mSpec.get() + seg1.mPos, val + seg2.mPos, seg1.mLen); 
719 }
Attached patch patchSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #498750 - Flags: review?(cbiesinger)
Attachment #498750 - Flags: approval2.0?
Comment on attachment 498750 [details] [diff] [review]
patch

Mass minusing patch approval that don't have high return. Please renominate if this is more important for 2.0 than it appears.
Attachment #498750 - Flags: approval2.0? → approval2.0-
Crash Signature: [@ nsStandardURL::SegmentIs]
Attachment #498750 - Flags: review?(cbiesinger) → review+
valentin, do we want this patch? reoslve the bug?
Flags: needinfo?(valentin.gosu)
Whiteboard: [necko-backlog]
We already have:
>    if (seg1.mLen == -1 || (!val && mSpec.IsEmpty()))
>        return true; // both are empty
>    if (!val)
>        return false;

This is essentially the same.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(valentin.gosu)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.