diff options
| author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-10-24 12:04:07 +0000 |
|---|---|---|
| committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-10-24 12:04:07 +0000 |
| commit | 2fe071d97154e4f250e964a3100737141a1a383b (patch) | |
| tree | 93e56d726df596384dd33dc4f26fee0bdb4a5c2f /libexec | |
| parent | 1689a3c4ac37c707e74fbaff09c732e724cd833b (diff) | |
Notes
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/rtld-elf/rtld.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 89b0fa4b48dd..850ba19b85a8 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1824,10 +1824,9 @@ cleanup1: if (dl > hint_stat.st_size) goto cleanup1; p = xmalloc(hdr.dirlistlen + 1); - - if (lseek(fd, hdr.strtab + hdr.dirlist, SEEK_SET) == -1 || - read(fd, p, hdr.dirlistlen + 1) != - (ssize_t)hdr.dirlistlen + 1 || p[hdr.dirlistlen] != '\0') { + if (pread(fd, p, hdr.dirlistlen + 1, + hdr.strtab + hdr.dirlist) != (ssize_t)hdr.dirlistlen + 1 || + p[hdr.dirlistlen] != '\0') { free(p); goto cleanup1; } |
