Closed Bug 273756 Opened 20 years ago Closed 20 years ago

Profile name and profile directory have trailing garbage.

Categories

(Core Graveyard :: Ports: Qt, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file, 1 obsolete file)

nsMemory::Clone doesn't append NULL so users must ensure one exists.
Attached patch ensures NULL after clone. (obsolete) — Splinter Review
Attachment #168233 - Flags: review?(zack)
Attachment #168233 - Flags: review?(zack) → review+
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.
Attached patch a fixSplinter Review
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)
Attachment #168233 - Attachment is obsolete: true
Comment on attachment 168244 [details] [diff] [review]
a fix

yeah, better.
Attachment #168244 - Flags: review+
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. 
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: cbiesinger → ports-qt
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: