From 0c4131d1be48af944f048b9a3bd37e93eb4450e2 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Sat, 7 Dec 2013 21:47:42 +0100 Subject: [PATCH] Use strncpy instead of strcpy Even though a user has to be stupid to trigger this, strncpy should be used if not to much hassle :) --- src/bin/e_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 97ad44a97..abbf72695 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -163,19 +163,19 @@ e_util_head_exec(int head, const char *cmd) /* yes it could overflow... but who will overflow DISPLAY eh? why? to * "exploit" your own applications running as you? */ - strcpy(buf, penv_display); + strncpy(buf, penv_display, sizeof(buf)); buf[p2 - penv_display + 1] = 0; snprintf(buf2, sizeof(buf2), "%i", head); strcat(buf, buf2); } else if (p1) /* "blah:x */ { - strcpy(buf, penv_display); + strncpy(buf, penv_display, sizeof(buf)); snprintf(buf2, sizeof(buf2), ".%i", head); strcat(buf, buf2); } else - strcpy(buf, penv_display); + strncpy(buf, penv_display, sizeof(buf)); ok = 1; exe = ecore_exe_run(cmd, NULL);