Open
Bug 601515
Opened 14 years ago
Updated 2 years ago
Avoid C-casts in updater code
Categories
(Toolkit :: Application Update, defect)
Toolkit
Application Update
Tracking
()
NEW
People
(Reporter: Dolske, Unassigned)
Details
Attachments
(1 file)
1.76 KB,
patch
|
robert.strong.bugs
:
feedback+
|
Details | Diff | Splinter Review |
Bug 601469 describes a fix to the updater code that was caused by trying to use a pointer to UTF16 data as ASCII. Normally the compiler could catch this kind of thing, except the C-style casts in this code (to deal with "const" fixup) were suppressing the error. Some C++ const_cast<> magic would be safer.
Reporter | ||
Comment 1•14 years ago
|
||
Day late and a dollar short. WIP, untested outside of compiling on Windows. Results in the following expected error when the bug 601469 patch is removed: ... nsUpdateDriver.cpp d:/mozilla-central/obj/toolkit/xre/../../../toolkit/xre/nsUpdateDriver.cpp(454) : d:/mozilla-central/obj/toolkit/xre/../../../toolkit/xre/nsUpdateDriver.cpp(454) : error C2440: '=' : cannot convert from 'const nsAString_internal::char_type *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast ... Wasn't sure if it was cleaner to make argv const and just have one const_cast<> in the WinLaunchChild() call [really? that's not const?!], or keep argv non-const, and const_cast<> each nsCString.get() when assigned to argv[n]. I did the former. Should also look through the actual app updater code for any similar issues.
Attachment #480528 -
Flags: feedback?
Reporter | ||
Updated•14 years ago
|
Attachment #480528 -
Flags: feedback? → feedback?(robert.bugzilla)
Comment 2•14 years ago
|
||
Comment on attachment 480528 [details] [diff] [review] Patch v.1 (WIP) Would be nice if the string conversion dance were removed http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsWindowsRestart.cpp#256 but that should be a separate bug
Attachment #480528 -
Flags: feedback?(robert.bugzilla) → feedback+
Reporter | ||
Comment 3•12 years ago
|
||
(clearing assignment of bugs I'm no long planning to work on)
Assignee: dolske → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•