Closed Bug 451506 Opened 14 years ago Closed 14 years ago

The return values of PR_Seek64 and PR_Available64 should be checked in FileImpl::Seek or else file corruption will occur

Categories

(Core :: XPCOM, defect)

1.8 Branch
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: hiro, Assigned: hiro)

Details

(Keywords: dataloss, fixed1.8.1.18)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080702 Ubuntu/8.04 (hardy) Firefox/2.0.0.15 Kazehakase/0.5.4
Build Identifier: 

The return values of PR_Seek64 and PR_Available64 should be checked in  FileImpl::Seek or else file corruption will occur.

When call Seek(NS_SEEK_END, 0), if PR_Available64 fails then fileSize become wrong value. So file pointer does not move to end of file.




Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Keywords: dataloss
Version: unspecified → 1.8 Branch
Attachment #334836 - Flags: superreview?(neil)
Attachment #334836 - Flags: review?(neil)
I suspect BUG 432514 was caused by this issue.
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

You need an XPCOM reviewer for this.
Attachment #334836 - Flags: review?(neil) → review?(benjamin)
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

r=me, although this code really just needs to die
Attachment #334836 - Flags: review?(benjamin) → review+
Attachment #334836 - Flags: superreview?(neil) → superreview+
I agree. But Thunderbird 2.0.0.x still uses this code. I don't think that cleanup XPCOM/obsolete codes from Thunderbird is good for its stability.
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

the patch will raise stability.
Attachment #334836 - Flags: approval1.8.1.17?
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

This will have to get looked at in 1.8.1.18. We're frozen.
Attachment #334836 - Flags: approval1.8.1.17? → approval1.8.1.18?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: checkin-needed
Comment on attachment 334836 [details] [diff] [review]
Check both values
[Checkin: Comment 9]

Approved for 1.8.1.18, a=dveditz for release-drivers
Attachment #334836 - Flags: approval1.8.1.18? → approval1.8.1.18+
Assignee: nobody → poincare
http://hg.mozilla.org/mozilla-central/rev/6601dacc93f7
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b1
Whiteboard: [checkin-needed: 1.8 branch]
Target Milestone: mozilla1.9.1b1 → ---
Attachment #334836 - Attachment description: Check both values. → Check both values [Checkin: Comment 9]
Patch checked into the 1.8 branch
Whiteboard: [checkin-needed: 1.8 branch]
You need to log in before you can comment on or make changes to this bug.