lslocks: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
f1de6d6526
commit
93d01a6233
|
@ -192,8 +192,10 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size)
|
|||
!strcmp(dp->d_name, ".."))
|
||||
continue;
|
||||
|
||||
errno = 0;
|
||||
|
||||
/* care only for numerical descriptors */
|
||||
if (!strtol(dp->d_name, (char **) NULL, 10))
|
||||
if (!strtol(dp->d_name, (char **) NULL, 10) || errno)
|
||||
continue;
|
||||
|
||||
if (!fstatat(fd, dp->d_name, &sb, 0)
|
||||
|
|
Loading…
Reference in New Issue