Closed Bug 290433 Opened 20 years ago Closed 13 years ago

Possible misuse of sizeof() in control_kicker.cpp

Categories

(Core Graveyard :: Embedding: ActiveX Wrapper, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: David.R.Gardiner, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

Running PREFast static code analysis gave this warning:

control_kicker.cpp(316) : warning 260: Sizeof * sizeof is almost always wrong:
261 * 1. Was a character count or a byte count intended ?
problem occurs in function 'FixupInProcRegistryEntry'

The 3rd parameter of GetModuleFileName is supposed to be the size of the buffer
in TCHARs.

The szMozCtlXLongPath array is already of type TCHAR so when we do a sizeof() we
don't need to multiply - we need to divide.


Reproducible: Always

Steps to Reproduce:



Expected Results:  
I think that this code should probably be something like:

sizeof(szMozCtlXLongPath) / sizeof(TCHAR));

instead.

-dave
Blocks: 283681
This should fix it - i'm not sure how to test that code though. Suggestions
welcome.

-dave
Assignee: adamlock → david.gardiner
Status: NEW → ASSIGNED
Attachment #180781 - Flags: review?(adamlock)
QA Contact: dunn5557 → activex
The ActiveX embedding API was removed in bug 662023 and friends, making this INVALID.

[Filter bugspam on activexinvalid]
Assignee: David.R.Gardiner → nobody
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: