Closed Bug 319977 Opened 19 years ago Closed 19 years ago

Minor string parser coding error in nsIconURI.cpp

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
trivial

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: alfredkayser, Assigned: alfredkayser)

Details

Attachments

(1 file, 3 obsolete files)

In nsIconURI.cpp there is some strange logic with string parsing: > if (startOfAttribute) > { > startOfAttribute += attributeNameSize; // skip over the attributeName > if (startOfAttribute) // is there something after the attribute name Probably the last line needs to read: > if (*startOfAttribute) // is there something after the attribute name Same goes for endOfAttribute further down. Patch following...
Attached patch Patch to correct string parsing logic (obsolete) (deleted) — Splinter Review
Simple patch to correct the scanner logic. Note, this whole function and the way that arg's are parsed is very inefficient... But probably not worth the trouble to optimize it?
Attachment #205631 - Flags: review?(mark)
Attached patch Oops, this one is only the nsIconURI part (obsolete) (deleted) — Splinter Review
Attachment #205631 - Attachment is obsolete: true
Attachment #205631 - Flags: review?(mark)
Attached patch v3: corrected syntax error (obsolete) (deleted) — Splinter Review
Attachment #205633 - Attachment is obsolete: true
Attachment #205635 - Flags: review?(cbiesinger)
Comment on attachment 205635 [details] [diff] [review] v3: corrected syntax error could you stay with using tabs, as the surrounding code uses them too? PRUint32 attributeNameSize = PL_strlen(attributeName); might want to replace this with just strlen, while you're here + const char * endofAttribute = PL_strchr(startOfAttribute, '&'); and this with strchr
Attachment #205635 - Flags: review?(cbiesinger) → review+
Bryner, can you sr this?
Attachment #205635 - Attachment is obsolete: true
Attachment #211831 - Flags: superreview?
Attachment #211831 - Flags: superreview? → superreview?(bryner)
Attachment #211831 - Flags: superreview?(bryner) → superreview+
Who can do the Checkin for me, as I don't have cvs (write) access? Thanks in advance, Alfred
Whiteboard: checkin required
Assignee: pavlov → alfredkayser
mozilla/modules/libpr0n/decoders/icon/nsIconURI.cpp 1.21
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: checkin required
Target Milestone: --- → mozilla1.9alpha
Verified to be committed to the tree. There is (luckely) no testcase for this bug.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: