forked from enlightenment/efl
efreet: Check size of buffer and '\0' terminate
CID 1039595
This commit is contained in:
parent
6b18d7b80a
commit
cc89eb2af9
|
@ -152,7 +152,10 @@ cache_scan(const char *path, const char *base_id, int priority, int recurse, int
|
||||||
if (*base_id)
|
if (*base_id)
|
||||||
snprintf(id, sizeof(id), "%s-%s", base_id, fname);
|
snprintf(id, sizeof(id), "%s-%s", base_id, fname);
|
||||||
else
|
else
|
||||||
strcpy(id, fname);
|
{
|
||||||
|
strncpy(id, fname, PATH_MAX);
|
||||||
|
id[PATH_MAX - 1] = '\0';
|
||||||
|
}
|
||||||
file_id = id;
|
file_id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue