summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <devilhorns@comcast.net>2013-05-24 18:25:03 +0100
committerDeon Thomas <PrinceAMD.Elive@gmail.com>2013-06-27 13:16:01 -0400
commit613908e6de52f3f75adf54b8008f1dcf6f531c40 (patch)
tree446374028cb680820022794591279151890fe804
parent82a9771df0c8b233487a15a4eeaafaa20c1d978f (diff)
Backport: 1d58f5f :: Don't allocate space for a mode name unless the nameLength is greater than 0.
Signed-off-by: Chris Michael <devilhorns@comcast.net> Signed-off-by: Deon Thomas <PrinceAMD.Elive@gmail.com>
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_randr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c
index d0bae168..076ccf6d 100644
--- a/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -713,10 +713,15 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
713 ret[i]->vSyncStart = res->modes[i].vSyncStart; 713 ret[i]->vSyncStart = res->modes[i].vSyncStart;
714 ret[i]->vSyncEnd = res->modes[i].vSyncEnd; 714 ret[i]->vSyncEnd = res->modes[i].vSyncEnd;
715 ret[i]->vTotal = res->modes[i].vTotal; 715 ret[i]->vTotal = res->modes[i].vTotal;
716 if ((ret[i]->name = 716 if (res->modes[i].nameLength > 0)
717 (malloc(res->modes[i].nameLength + 1)))) 717 {
718 strncpy(ret[i]->name, res->modes[i].name, 718 if ((ret[i]->name =
719 (res->modes[i].nameLength + 1)); 719 (malloc(res->modes[i].nameLength + 1))))
720 strncpy(ret[i]->name, res->modes[i].name,
721 (res->modes[i].nameLength + 1));
722 else
723 ret[i]->name = NULL;
724 }
720 else 725 else
721 ret[i]->name = NULL; 726 ret[i]->name = NULL;
722 727