--- plugins/ini.c | 4 ++++ plugins/scale.c | 8 +++++++- src/screen.c | 5 +++++ 3 files changed, 16 insertions(+), 1 deletions(-) diff --git a/plugins/ini.c b/plugins/ini.c index b8ace8c..4248eb0 100644 --- a/plugins/ini.c +++ b/plugins/ini.c @@ -544,6 +544,10 @@ parseAction (CompDisplay *d, int len = strlen (optionName) - strlen (optionType); char *realOptionName = malloc (sizeof (char) * (len+1)); + if (!realOptionName) { + return FALSE; + } + strncpy (realOptionName, optionName, len); realOptionName[len] = '\0'; diff --git a/plugins/scale.c b/plugins/scale.c index cd8933f..550f22e 100644 --- a/plugins/scale.c +++ b/plugins/scale.c @@ -502,7 +502,12 @@ getSlotAreas (CompScreen *s) SCALE_SCREEN(s); size = malloc (s->nOutputDev * sizeof (int)); + if (!size) + return NULL; + slotAreas = malloc (s->nOutputDev * sizeof (SlotArea)); + if (!slotAreas) + return NULL; left = ss->nWindows; @@ -1391,7 +1396,8 @@ scaleSelectWindow (CompWindow *w) if (old) addWindowDamage (old); - addWindowDamage (new); + if (new) + addWindowDamage (new); } } diff --git a/src/screen.c b/src/screen.c index c32bf49..b036ff3 100644 --- a/src/screen.c +++ b/src/screen.c @@ -464,6 +464,8 @@ setScreenOption (CompScreen *screen, vsize = compFindOption (screen->opt, NUM_OPTIONS (screen), "vsize", NULL); + if (!vsize) + return FALSE; if (o->value.i * screen->width > MAXSHORT) return FALSE; @@ -480,6 +482,9 @@ setScreenOption (CompScreen *screen, hsize = compFindOption (screen->opt, NUM_OPTIONS (screen), "hsize", NULL); + if (!hsize) + return FALSE; + if (o->value.i * screen->height > MAXSHORT) return FALSE; -- 1.5.2.3