From 1eb6a40fdd0943c75049fce8f7a8437e44806888 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 20 Dec 2022 11:51:31 +0100 Subject: [PATCH] src: restore lseek() error check in file.cpp --- src/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file.cpp b/src/file.cpp index 6e6c0d7f..72176228 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -135,7 +135,7 @@ upx_off_t FileBase::seek(upx_off_t off, int whence) { } // SEEK_CUR falls through to here upx_off_t rv = ::lseek(_fd, off, whence); - if (0 == (1+ rv)) // lazy coding to check for "-1" failure of ::lseek + if (rv < 0) throwIOException("seek error", errno); return rv - _offset; }