summaryrefslogtreecommitdiff
path: root/src/menus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/menus.c')
-rw-r--r--src/menus.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/menus.c b/src/menus.c
index 4c0e22a..6440bfc 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -1989,8 +1989,8 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win,
break;
case F_CUT:
- strcpy(tmp, action);
- strcat(tmp, "\n");
+ strlcpy(tmp, action, sizeof(tmp));
+ strlcat(tmp, "\n", sizeof(tmp));
XStoreBytes(dpy, tmp, strlen(tmp));
break;
@@ -2364,7 +2364,11 @@ Execute(char *s)
oldDisplay[0] = '\0';
doisplay=getenv("DISPLAY");
if (doisplay)
- strcpy (oldDisplay, doisplay);
+ if (strlcpy (oldDisplay, doisplay, sizeof(oldDisplay)) >=
+ sizeof(oldDisplay)) {
+ /* some error report? */
+ return;
+ }
/*
* Build a display string using the current screen number, so that
@@ -2374,8 +2378,8 @@ Execute(char *s)
*/
colon = strrchr (ds, ':');
if (colon) { /* if host[:]:dpy */
- strcpy (buf, "DISPLAY=");
- strcat (buf, ds);
+ strlcpy (buf, "DISPLAY=", sizeof(buf));
+ strlcat (buf, ds, sizeof(buf));
colon = buf + 8 + (colon - ds); /* use version in buf */
dot1 = strchr (colon, '.'); /* first period after colon */
if (!dot1) dot1 = colon + strlen (colon); /* if not there, append */