Closed
Bug 730140
Opened 9 years ago
Closed 9 years ago
NUL-terminate strings when dumping the heap
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: sfink, Assigned: sfink)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
3.24 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
There were a couple of paths through the heap-dumping where the buffer was not NUL-terminated (when no detail was available, or when detail was available but one of the cases was chosen that didn't generate anything). With this patch, I don't seem to see any more mangled strings in the heap dump output.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #600216 -
Flags: review?(continuation)
Comment 2•9 years ago
|
||
Comment on attachment 600216 [details] [diff] [review] NUL-terminate strings when dumping the heap Review of attachment 600216 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for looking into this! This part of OBJECT needs a null terminator in the else branch: 2545 if (fun->atom) 2546 PutEscapedString(buf, bufsize, fun->atom, 0); I'm not sure what the best way to do that is. r=me with that.
Attachment #600216 -
Flags: review?(continuation) → review+
Comment 3•9 years ago
|
||
Oh, and while you are there, if you could remove the totally useless: -#ifdef HAVE_XPCONNECT -#include "dump_xpc.h" -#endif that would be great. Thanks.
Comment 4•9 years ago
|
||
and this glob: -#ifdef HAVE_XPCONNECT - if (clasp->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS) { - void *privateThing = obj->getPrivate(); - if (privateThing) { - const char *xpcClassName = GetXPCObjectClassName(privateThing); - if (xpcClassName) - name = xpcClassName; - } - } -#endif
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #2) > This part of OBJECT needs a null terminator in the else branch: > > 2545 if (fun->atom) > 2546 PutEscapedString(buf, bufsize, fun->atom, 0); > > I'm not sure what the best way to do that is. r=me with that. Doh! Didn't notice that one lurking there. It also shouldn't have a space prepended, so I moved the space into the printfs. https://hg.mozilla.org/integration/mozilla-inbound/rev/52fe920f2685
Target Milestone: --- → mozilla15
Assignee | ||
Updated•9 years ago
|
Target Milestone: mozilla15 → mozilla13
Comment 6•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/52fe920f2685
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•