Closed Bug 560135 Opened 10 years ago Closed 10 years ago

nsTextToSubURI::UnEscapeAndConvert overallocates pBuf

Categories

(Core :: Internationalization, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

117 NS_IMETHODIMP  nsTextToSubURI::UnEscapeAndConvert(

144       PRUnichar *pBuf = nsnull;
146       PRInt32 outlen = 0;
147       if (NS_SUCCEEDED(rv = decoder->GetMaxLength(unescaped, len, &outlen))) {
148         pBuf = (PRUnichar *) NS_Alloc((outlen+1)*sizeof(PRUnichar*));

153             pBuf[outlen] = 0;

the sizeof should be PRUnichar, not PRUnichar*
Attached patch patchSplinter Review
Assignee: smontagu → timeless
Status: NEW → ASSIGNED
Attachment #439858 - Flags: review?(smontagu)
Comment on attachment 439858 [details] [diff] [review]
patch

r=me
Attachment #439858 - Flags: review?(smontagu) → review+
http://hg.mozilla.org/mozilla-central/rev/54829d9e173c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.