summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:47:42 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:47:42 +0100
commit0c4131d1be48af944f048b9a3bd37e93eb4450e2 (patch)
tree7c40bc4fddb68fdc36cdef197323ec08dd25bdc0
parent7542ddef4c3f2cee75d115cf4e87ee3bbcc99509 (diff)
downloadenlightenment-0c4131d1be48af944f048b9a3bd37e93eb4450e2.tar.gz
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 :)
-rw-r--r--src/bin/e_utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 97ad44a974..abbf726950 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);