Closed
Bug 268832
Opened 21 years ago
Closed 21 years ago
crash if I try to get a string from stringbundle by undefined key
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: surkov, Assigned: smontagu)
Details
(Keywords: crash)
Attachments
(1 file)
977 bytes,
patch
|
jshin1987
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Crach if I post undefined as argument to GetStringFromName() method of
nsIStringBundle interface
Reproducible: Always
Steps to Reproduce:
function stringBundle(url){
this.getString=function(key, params){
if(!params) return this.bundle.GetStringFromName(key);
return this.bundle.formatStringFromName(key, params, params.length);
}
this.service=Components.classes["@mozilla.org/intl/stringbundle;1"].
createInstance(Components.interfaces.nsIStringBundleService);
this.bundle=this.service.createBundle(url);
}
var bundle=new stringBundle("chrome://global/locale/dialog.properties");
bundle.getString(undefined);
![]() |
||
Comment 1•21 years ago
|
||
It looks to me that i18n component is right for string bundles...
Assignee: kairo → smontagu
Component: Localization → Internationalization
QA Contact: mmx_bugzilla → amyy
Summary: crach if I try to get a string from stringbundle by undefined key → crash if I try to get a string from stringbundle by undefined key
Assignee | ||
Comment 2•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #165418 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #165418 -
Flags: review?(jshin)
Comment 3•21 years ago
|
||
Comment on attachment 165418 [details] [diff] [review]
Patch
r=jshin
Attachment #165418 -
Flags: review?(jshin) → review+
Comment 4•21 years ago
|
||
Comment on attachment 165418 [details] [diff] [review]
Patch
The NS_ENSURE typically belongs before the nsresult rv. FormatStringFromName
doesn't have any error checking. Also null-check out params perhaps?
Attachment #165418 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Assignee | ||
Comment 5•21 years ago
|
||
Thanks for reviews, patch checked in with Neil's comments addressed
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•