Closed
Bug 51056
Opened 25 years ago
Closed 25 years ago
error in reading unreachable preferences file
Categories
(Core :: Preferences: Backend, defect, P3)
Core
Preferences: Backend
Tracking
()
VERIFIED
FIXED
People
(Reporter: buster, Assigned: dveditz)
Details
(Whiteboard: [nsbeta3+]reviewed patch in hand)
Attachments
(1 file)
|
1.41 KB,
patch
|
Details | Diff | Splinter Review |
from the original posting by Nigel Cole <N.Cole@sc98c.demon.co.uk> on
netscape.public.mozilla.seamonkey:
I think there's a problem in the code for reading the preferences file.
According to:
http://lxr.mozilla.org/seamonkey/source/modules/libpref/src/prefapi.c#265
the preferences file is read using an fread in pref_OpenFile, but the
return value isn't checked (line 291); in the event of a system problem,
the fread can return 0 and the code continues assuming a fileLength of 0.
(I'm bumping into this a lot with Communicator, which presumably uses
similar code).
I believe this can be fixed by simply adding:
if (fileLength == 0)
ok = PREF_ERROR;
else
before line 293.
System: Networked Sun SPARCs running Solaris 2.6, though the problem
could affect any system where the fread can fail and return 0.
Comment 1•25 years ago
|
||
Updated•25 years ago
|
| Assignee | ||
Updated•25 years ago
|
| Assignee | ||
Comment 2•25 years ago
|
||
Actually preferences backend, I'll take this.
| Assignee | ||
Comment 4•25 years ago
|
||
Ick, prefs shouldn't be using raw fread() anyway, it should be using NSPR
wrappers.
| Assignee | ||
Updated•25 years ago
|
Whiteboard: reviewed patch in hand → [nsbeta3+]reviewed patch in hand
| Assignee | ||
Comment 5•25 years ago
|
||
Patch checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 6•25 years ago
|
||
Dan, you said that the prefs shouldn't be using raw fread(), they should be
using NSPR wrappers. Did you file a bug on that, or should I do it?
| Assignee | ||
Comment 7•25 years ago
|
||
No, I didn't file a but against the File i/o used in the low-level prefs.
You need to log in
before you can comment on or make changes to this bug.
Description
•