If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[PP] PR_Seek should allow offsets past EOF

VERIFIED FIXED

Status

NSPR
NSPR
P3
normal
VERIFIED FIXED
19 years ago
18 years ago

People

(Reporter: gordon, Assigned: Steve Dagley)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
John McMullen reports that PR_Seek on other platforms actually allows an offset
past the end of file.  PR_Seek on macintosh should be
made to work the same way.
(Reporter)

Updated

19 years ago
Summary: [PP] → [PP] PR_Seek should allow offsets past EOF

Updated

19 years ago
Assignee: wtc → gordon

Comment 1

19 years ago
Reassigned the bug to gordon.
(Reporter)

Updated

19 years ago
Status: NEW → ASSIGNED

Updated

19 years ago
Target Milestone: M4

Comment 2

19 years ago
Changed target milestone to M4.

I thought this was fixed already?

Comment 3

19 years ago
Don, pink fixed the only one known place (in the registry code) where this was
called with the win/unix assumption.  The real fix is to make the win/unix
assumption valid always in future.

Pink's fix was to write out enough bogus data to make the seek work.
And i'm sure that I'm writing out random bits of memory to disk, so there are
certain privacy issues involved in that ;)

Comment 5

19 years ago
Note that while PR_Seek on Unix/Win platforms allows setting the file pointer
beyond the current end of file, the file size itself is not changed by the seek
operation. The next PR_Write call causes the write to happen at the new pointer;
the data between the original end-of-file position and the position of the file
pointer after PR_Seek is zero-filled by the OS.

That is, if PR_Seek is used to seek beyond the end-of-file and the file is
closed, there will be no change to the contents of the file (or the file size)
on Unix/win platforms.

To emulate the same semantics on Mac, one can save the file pointer in nspr's fd
and extend the file on the next call to PR_Write. Also, file extension should be
done with zero-filled pages, rather than random data.

Comment 6

19 years ago
Changed target milestone to M6.
(Assignee)

Updated

19 years ago
Assignee: gordon → sdagley
Status: ASSIGNED → NEW
(Assignee)

Comment 7

19 years ago
Offloading some of gordon's doomage

Comment 8

19 years ago
NSPR now has its own Bugzilla product.  Moving this bug to the NSPR product.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 9

19 years ago
Fix checked in.  The old code would actually re-set the EOF on a seek past the
current EOF but did not advance the file mark after resetting EOF.

Comment 10

19 years ago
this fix is not visible to qa. if you think this bug should be reopened,
please do so.

will mark as verified.

Updated

19 years ago
Status: RESOLVED → VERIFIED

Updated

18 years ago
Target Milestone: M6 → ---
You need to log in before you can comment on or make changes to this bug.