fs/base: securily use readlink
as reported by Coverity with CIDs 1287031 and 1287032
Этот коммит содержится в:
родитель
33841361c0
Коммит
59f298a534
@ -68,7 +68,7 @@ void mca_fs_base_get_parent_dir ( char *filename, char **dirnamep)
|
||||
int namelen;
|
||||
char linkbuf[PATH_MAX+1];
|
||||
|
||||
namelen = readlink(filename, linkbuf, PATH_MAX+1);
|
||||
namelen = readlink(filename, linkbuf, PATH_MAX);
|
||||
if (namelen == -1) {
|
||||
/* something strange has happened between the time that
|
||||
* we determined that this was a link and the time that
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user