Closed Bug 282800 Opened 19 years ago Closed 19 years ago

Potential NULL argument 3 to 'memset' in nsUnicodeToJamoTTF.cpp

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: David.R.Gardiner, Assigned: jshin1987)

References

Details

(Keywords: fixed-aviary1.0.1, fixed1.7.6)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

PREfast static code analysis of nsUnicodeToJamoTTF.cpp gives the following warning:

nsunicodetojamottf.cpp(327) : warning 309: Potential NULL argument 3 to 'memset'.
problem occurs in function 'nsUnicodeToJamoTTF::Reset'

This line is currently:

memset(mJamos, sizeof(mJamosStatic), 0); 

I wonder if the arguments for the memset are the wrong way around?

Should this actually be:

memset(mJamos, 0, sizeof(mJamosStatic)); 

?

-dave

Reproducible: Always

Steps to Reproduce:
Taking. Thanks for catching it. You're right that the second argument should be 0. 
Assignee: smontagu → jshin1987
Attached patch patch(1-liner)Splinter Review
This is a simple one-liner that does the right thing and is safe for branches.
Attachment #174763 - Flags: superreview?(bzbarsky)
Attachment #174763 - Flags: review?(smontagu)
Attachment #174763 - Flags: approval1.7.6?
Attachment #174763 - Flags: approval-aviary1.0.1?
Comment on attachment 174763 [details] [diff] [review]
patch(1-liner)

sr=bzbarsky
Attachment #174763 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 174763 [details] [diff] [review]
patch(1-liner)

r=dveditz
a=dveditz for the 1.7 and aviary1.0.1 branches

The aviary1.0.1 branch is closing at midnight PST (may in fact have until 2am).
Get it in tonight or it misses the bus.
Attachment #174763 - Flags: review?(smontagu)
Attachment #174763 - Flags: review+
Attachment #174763 - Flags: approval1.7.6?
Attachment #174763 - Flags: approval1.7.6+
Attachment #174763 - Flags: approval-aviary1.0.1?
Attachment #174763 - Flags: approval-aviary1.0.1+
Thanks for r/sr/a. landed in branches (1.7.x and av 1.0.1)and trunk
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Blocks: 283681
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: