diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-01-03 18:42:51 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-01-03 18:42:51 +1000 |
commit | da13b83737e85e2d8ed9c737ed641037a8c8ae5e (patch) | |
tree | 19aada688886502fc9f18c647a85727b7fe842b0 /src/gwin/gwin_gwin.c | |
parent | 476d11d599ec4862ae2191f606e10a85bb7c3c23 (diff) | |
download | uGFX-da13b83737e85e2d8ed9c737ed641037a8c8ae5e.tar.gz uGFX-da13b83737e85e2d8ed9c737ed641037a8c8ae5e.tar.bz2 uGFX-da13b83737e85e2d8ed9c737ed641037a8c8ae5e.zip |
Safety protection in creation of extended GWIN types.
Diffstat (limited to 'src/gwin/gwin_gwin.c')
-rw-r--r-- | src/gwin/gwin_gwin.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gwin/gwin_gwin.c b/src/gwin/gwin_gwin.c index 03902c9b..eb51b89a 100644 --- a/src/gwin/gwin_gwin.c +++ b/src/gwin/gwin_gwin.c @@ -16,6 +16,8 @@ #include "gwin_class.h" +#include <string.h> + /*----------------------------------------------- * Data *-----------------------------------------------*/ @@ -97,6 +99,10 @@ GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit pgw->font = defaultFont; #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 ((pgw->flags & GWIN_FLG_DYNAMIC)) gfxFree(pgw); |