[Pyobjc-dev] [ pyobjc-Bugs-805318 ] NSRectFillList() malloc bogosity
Brought to you by:
ronaldoussoren
From: SourceForge.net <no...@so...> - 2003-09-12 20:41:43
|
Bugs item #805318, was opened at 2003-09-12 16:41 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=805318&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Bill Bumgarner (bbum) Assigned to: Nobody/Anonymous (nobody) Summary: NSRectFillList() malloc bogosity Initial Comment: I introduced some bogosity into NSRectFillList in _AppKit.m to fix a crasher. In particular: *************** *** 339,343 **** } ! rects = malloc(rectCount * sizeof(NSRect)); if (rects == NULL) { PyErr_NoMemory(); --- 340,345 ---- } ! #warning The (*4) in the following is bogus. Without it, we crash with what appears to be corrupted memory. I don't know why but figure that not crashing is preferable to crashing until one of us has time to figure this out. Really, I suspect Ronald will take one look at this and, being about 10x brighter than me at this sort of thing, will know exactly what is wrong... :-) ! rects = malloc((rectCount * sizeof(NSRect)) * 4); if (rects == NULL) { PyErr_NoMemory(); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=805318&group_id=14534 |