summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-01-06 18:08:17 -0800
committerVinson Lee <vlee@vmware.com>2010-01-06 18:08:41 -0800
commit25ffd7627828d5a6d1858e0fd5f2a4b796c72be8 (patch)
tree28e3cd050520d8c58e4ccc0112c2a66c8b6f74c7 /progs
parent468f270f3fc0efc136d03d0b6022916ddd8ea893 (diff)
progs/xdemos: Check for string overflow.
Diffstat (limited to 'progs')
-rw-r--r--progs/xdemos/sharedtex_mt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/progs/xdemos/sharedtex_mt.c b/progs/xdemos/sharedtex_mt.c
index f924448cc4..a90903adec 100644
--- a/progs/xdemos/sharedtex_mt.c
+++ b/progs/xdemos/sharedtex_mt.c
@@ -174,6 +174,10 @@ AddWindow(Display *dpy, const char *displayName, int xpos, int ypos,
{
static int id = 0;
struct window *h = &Windows[NumWindows];
+ if (strlen(displayName) + 1 > sizeof(h->DisplayName)) {
+ Error(displayName, "string overflow");
+ return NULL;
+ }
strcpy(h->DisplayName, displayName);
h->Dpy = dpy;
h->Win = win;