X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Fxdemos%2Fsharedtex_mt.c;h=a90903adeca7e098ffa8daf510d78aa97f766d2d;hb=8d86d395dcf6a5f192b6987485bb7aef49f1fefc;hp=f924448cc436444b520bf3f52297b314f53a69d3;hpb=4dcdf3b9c67f1481d46c1decba84c9c55698db4c;p=mesa.git 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;