projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
468f270
)
progs/xdemos: Check for string overflow.
author
Vinson Lee
<vlee@vmware.com>
Thu, 7 Jan 2010 02:08:17 +0000
(18:08 -0800)
committer
Vinson Lee
<vlee@vmware.com>
Thu, 7 Jan 2010 02:08:41 +0000
(18:08 -0800)
progs/xdemos/sharedtex_mt.c
patch
|
blob
|
history
diff --git
a/progs/xdemos/sharedtex_mt.c
b/progs/xdemos/sharedtex_mt.c
index f924448cc436444b520bf3f52297b314f53a69d3..a90903adeca7e098ffa8daf510d78aa97f766d2d 100644
(file)
--- 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;