summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_mime.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 10:52:02 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 13:02:53 +0200
commit7d1703ea0dd7e5eb2eedb78f1a9f5f008907c41c (patch)
tree849553a4d66329a009e7d830a24a83b5370932de /src/lib/efreet/efreet_mime.c
parentf854efd041b816553d0710dd0fd5d7372144443c (diff)
efreet: Be paranoid about '\0' termination
CID: #1039722
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_mime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index 9dcec0578f..7232176804 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -704,9 +704,11 @@ efreet_mime_special_check(const char *file)
704 char path[PATH_MAX]; 704 char path[PATH_MAX];
705 705
706 strncpy(path, file, PATH_MAX); 706 strncpy(path, file, PATH_MAX);
707 path[PATH_MAX - 1] = '\0';
707 708
708 path_len = strlen(file); 709 path_len = strlen(file);
709 strncpy(parent, path, PATH_MAX); 710 strncpy(parent, path, PATH_MAX);
711 parent[PATH_MAX - 1] = '\0';
710 712
711 /* Kill any trailing slash */ 713 /* Kill any trailing slash */
712 parent[--path_len] = '\0'; 714 parent[--path_len] = '\0';