mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 16:50:10 +01:00
progs/xdemos: Check for string overflow.
This commit is contained in:
parent
468f270f3f
commit
25ffd76278
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue