---
 mingw-w64-crt/stdio/_lseeki64.c | 2 +-
 mingw-w64-crt/stdio/fsetpos.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/stdio/_lseeki64.c b/mingw-w64-crt/stdio/_lseeki64.c
index 2408a6cfb6eb..6ead4a98e182 100644
--- a/mingw-w64-crt/stdio/_lseeki64.c
+++ b/mingw-w64-crt/stdio/_lseeki64.c
@@ -11,7 +11,7 @@
 /* Define 64-bit _lseeki64() function via 32-bit _lseek() function */
 __int64 __cdecl _lseeki64(int fd, __int64 offset, int whence)
 {
-  if (offset > LONG_MAX)
+  if (offset < LONG_MIN || offset > LONG_MAX)
   {
     errno = EOVERFLOW;
     return -1;
diff --git a/mingw-w64-crt/stdio/fsetpos.c b/mingw-w64-crt/stdio/fsetpos.c
index 1d3f0322d5b2..4bb9e5cb7e47 100644
--- a/mingw-w64-crt/stdio/fsetpos.c
+++ b/mingw-w64-crt/stdio/fsetpos.c
@@ -14,7 +14,7 @@ int __cdecl fsetpos(FILE *__restrict__ _File, const fpos_t 
*__restrict__ _Pos)
 {
   long pos32;
 
-  if (*_Pos > LONG_MAX)
+  if (*_Pos < LONG_MIN || *_Pos > LONG_MAX)
   {
     errno = EOVERFLOW;
     return -1;
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to