Closed Bug 823369 Opened 13 years ago Closed 13 years ago

mozilla::widget::EventFlags assumes its size is less than uint32_t

Categories

(Core :: Widget, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: bent.mozilla, Assigned: masayuki)

References

Details

Attachments

(1 file, 2 obsolete files)

This code will corrupt the stack if the size of the EventFlags struct ever grows beyond a uint32_t. 571 inline uint32_t GetRawFlags() const 572 { 573 uint32_t result = 0; 574 memcpy(&result, this, sizeof(EventFlags)); 575 return result; 576 }
MOZ_STATIC_ASSERT(sizeof(mozilla::widget::EventFlags) <= sizeof(uint32_t)); would be enough at the moment.
Blocks: 813445
Attached patch PatchSplinter Review
oops.
Attachment #694797 - Attachment is obsolete: true
Comment on attachment 694799 [details] [diff] [review] Patch "mozilla::widget::EventFlags must not be bigger than the RawFlags" that should take care of the = part of the comparison.
Attachment #694799 - Flags: review?(bugs) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: