From: Eric Biggers Date: Tue, 5 Aug 2014 02:16:46 +0000 (-0500) Subject: read_wim_header(): Check return value of lseek() X-Git-Tag: v1.7.1~8 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=32614c9f026be20f0336df3053b91090dc53297f read_wim_header(): Check return value of lseek() --- diff --git a/src/header.c b/src/header.c index 57cea04f..e223ce9f 100644 --- a/src/header.c +++ b/src/header.c @@ -96,7 +96,9 @@ read_wim_header(WIMStruct *wim, struct wim_header *hdr) /* Pipable WIM: Use header at end instead, unless * actually reading from a pipe. */ if (!in_fd->is_pipe) { - lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END); + ret = WIMLIB_ERR_READ; + if (-1 == lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END)) + goto read_error; ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr)); if (ret) goto read_error;