Closed
Bug 9596
Opened 27 years ago
Closed 27 years ago
[PP]Electric fence mod for mozilla/xpcom/typelib/xpt/tools/xpt_link
Categories
(Core :: XPConnect, defect, P3)
Tracking
()
VERIFIED
FIXED
M9
People
(Reporter: kherron+mozilla, Assigned: mike+mozilla)
Details
Attachments
(1 file)
|
4.30 KB,
patch
|
Details | Diff | Splinter Review |
I modified the Mozilla build process to link everything with the electric fence
library (a debugging memory-allocation lib) and got a hit on line 175 of
xpt_link.c for an attempt to allocate 0 bytes. EF treats this as a potential
bug and halts when this occurs. xpt_link was processing _xpidlgen/nsrootidl.xpt
which contains 0 interfaces, so the program was attempting to allocate a 0-sized
array to contain them. xpt_link as written has no problem with this, but it'd
be nice for the build process to complete with EF in use, and it's easy to work
around this problem.
While inspecting the code I noted two other hypothetical problems:
1) If none of the input files contains interfaces, arrays IDE_array and
fix_array will never be initialized. I don't know if this is actually likely.
2) calloc() et al. are allowed to return a real pointer to allocated memory
in response to a request for 0 bytes. xpt_link could leak such an allocation.
The attached patch corrects all three of these issues.
| Reporter | ||
Comment 1•27 years ago
|
||
| Assignee | ||
Updated•27 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•27 years ago
|
||
Looks like a great patch. I have applied it to my tree, and everything still
works. Awaiting a green tree to check it into.
Marking as assigned.
| Assignee | ||
Updated•27 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 4•27 years ago
|
||
Saw a tiny spot of green. Patch applied.
Summary: Electric fence mod for mozilla/xpcom/typelib/xpt/tools/xpt_link → [PP]Electric fence mod for mozilla/xpcom/typelib/xpt/tools/xpt_link
Target Milestone: M9
kherron, could you check out and set but to Verified now if all is well?
Thanks!
| Reporter | ||
Updated•27 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•