From: Vinson Lee Date: Thu, 7 Jan 2010 02:08:17 +0000 (-0800) Subject: progs/xdemos: Check for string overflow. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25ffd7627828d5a6d1858e0fd5f2a4b796c72be8;p=mesa.git progs/xdemos: Check for string overflow. --- diff --git a/progs/xdemos/sharedtex_mt.c b/progs/xdemos/sharedtex_mt.c index f924448cc43..a90903adeca 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;