Safety protection in creation of extended GWIN types.
This commit is contained in:
parent
476d11d599
commit
da13b83737
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#include "gwin_class.h"
|
#include "gwin_class.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/*-----------------------------------------------
|
/*-----------------------------------------------
|
||||||
* Data
|
* Data
|
||||||
*-----------------------------------------------*/
|
*-----------------------------------------------*/
|
||||||
|
@ -97,6 +99,10 @@ GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit
|
||||||
pgw->font = defaultFont;
|
pgw->font = defaultFont;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Make sure we don't create nasty problems for ourselves
|
||||||
|
if (vmt->size > sizeof(GWindowObject))
|
||||||
|
memset(pgw+1, 0, vmt->size - sizeof(GWindowObject));
|
||||||
|
|
||||||
if (!_gwinWMAdd(pgw, pInit)) {
|
if (!_gwinWMAdd(pgw, pInit)) {
|
||||||
if ((pgw->flags & GWIN_FLG_DYNAMIC))
|
if ((pgw->flags & GWIN_FLG_DYNAMIC))
|
||||||
gfxFree(pgw);
|
gfxFree(pgw);
|
||||||
|
|
Loading…
Add table
Reference in a new issue