subtract the buffer len by 1 to account for the needed space for a
NUL terminator, as readlink isn't guaranteed to provide one
Reported by: Coverity
CID:
1331293,
1332105
* really not much point in bothering with this. */
return (0);
#else
- char buff[300];
+ char buff[301];
struct stat st;
ssize_t linklen;
int r;
return (0);
if (contents == NULL)
return (1);
- linklen = readlink(pathname, buff, sizeof(buff));
+ linklen = readlink(pathname, buff, sizeof(buff) - 1);
if (linklen < 0) {
failure_start(file, line, "Can't read symlink %s", pathname);
failure_finish(NULL);