From d4475e5b19a1b61a421d24be57184876bf4fe93c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 11:03:40 +0100 Subject: [PATCH] Added handling of return value --- src/osgPlugins/zip/unzip.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/zip/unzip.cpp b/src/osgPlugins/zip/unzip.cpp index 045a0372f..3fb682b33 100644 --- a/src/osgPlugins/zip/unzip.cpp +++ b/src/osgPlugins/zip/unzip.cpp @@ -197,7 +197,9 @@ typedef struct tm_unz_s // some windows<->linux portability things #ifdef ZIP_STD DWORD GetFilePosU(HANDLE hfout) -{ struct stat st; fstat(FILENO(hfout),&st); +{ + struct stat st; + if (fstat(FILENO(hfout),&st)<0) return 0xFFFFFFFF; if ((st.st_mode&S_IFREG)==0) return 0xFFFFFFFF; return ftell(hfout); }