efreet: Be paranoid about '\0' termination

CID: #1039722
This commit is contained in:
Sebastian Dransfeld 2013-08-07 10:52:02 +02:00
parent f854efd041
commit 7d1703ea0d
1 changed files with 2 additions and 0 deletions

View File

@ -704,9 +704,11 @@ efreet_mime_special_check(const char *file)
char path[PATH_MAX];
strncpy(path, file, PATH_MAX);
path[PATH_MAX - 1] = '\0';
path_len = strlen(file);
strncpy(parent, path, PATH_MAX);
parent[PATH_MAX - 1] = '\0';
/* Kill any trailing slash */
parent[--path_len] = '\0';