nsMemory::Clone doesn't append NULL so users must ensure one exists.
I apologize for sticking my nose into this bug, but I happened to read the patch and I don't understand how it fixes the problem. If the source strings are 0-terminated, then I don't understand what is wrong with the original code; it seems to me it'll correctly clone each string including its 0 terminator. If the source strings aren't 0-terminated, then the original code could fail with the symptom described here, because the strlen() call would return an invalid length. But the new code in the patch also calls strlen() on the source strings, so it would fail the same way. I also wonder why the second copy operation calls strlen(aDir) instead of strlen(aName), but the original code does that so maybe it's deliberate.
Created attachment 168244 [details] [diff] [review] a fix Yeah, I don't really mind the patch as long as the bug, which is the use of aDir instead of aName is fixed. I would prefer though if this patch would be used instead (both for GTK+ and Qt embedding code)
Comment on attachment 168244 [details] [diff] [review] a fix yeah, better.
Did this patch just get lost in the shuffle? Could someone land it please? Or let me know and I'll do it...
lost in the shuffle. land it if you can.
I applied it a while ago, but forgot to close the report. Closing it now.
12 years ago