Open Bug 781111 Opened 13 years ago Updated 3 years ago

Should use nsByteArray::GetBufferPos() for md5 hash string

Categories

(MailNews Core :: Backend, defect)

defect

Tracking

(Not tracked)

People

(Reporter: hiro, Unassigned)

Details

(Whiteboard: [patchlove])

Attachments

(1 file)

Attached patch FixSplinter Review
There are some unconditional characters on GetSize().
Attachment #649993 - Flags: review?(mbanner)
Attachment #649993 - Flags: review?(mbanner) → review?(irving)
Comment on attachment 649993 [details] [diff] [review] Fix Review of attachment 649993 [details] [diff] [review]: ----------------------------------------------------------------- I think I understand this change, but it would have been helpful to have a more detailed explanation in the bug report and patch description. Here's what I think the fix is: The nsMsgLineBuffer has an allocated size, returned by GetSize(), which is larger than the amount of actual data we read - so the existing code using GetSize() is hashing our line plus all the junk occupying the rest of the buffer Changing to GetBufferPos() means that we only hash from the beginning of the buffer to the end of the actual data written to the buffer. My r+ is based on this assumption; if my analysis is not correct please cancel the r+ and add more explanation to the bug.
Attachment #649993 - Flags: review?(irving) → review+
Hiro shall we set checking needed for this patch ?
Whiteboard: [patchlove]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: