Use a more explicit check on readlink result

This should help the static analyzer to understand the code.
This commit is contained in:
Andrea Mazzoleni 2017-12-12 00:01:25 +01:00
parent ee10b6f9a6
commit 976338f84c
2 changed files with 2 additions and 2 deletions

View file

@ -247,7 +247,7 @@ static void read_dir(tommy_hashdyn* poolset, const char* base_dir, const char* s
int ret;
ret = readlink(path_next, linkto, sizeof(linkto));
if (ret < 0 || ret == sizeof(linkto)) {
if (ret < 0 || ret >= PATH_MAX) {
/* LCOV_EXCL_START */
log_fatal("Error in readlink symlink '%s'. %s.\n", path_next, strerror(errno));
exit(EXIT_FAILURE);