summaryrefslogtreecommitdiff
path: root/vcl/generic/glyphs/gcach_ftyp.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-24 14:11:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-24 15:05:00 +0000
commit5b0395948e52b1e224ca605d453a8b27a7adc61e (patch)
treeb7730f7cbac56b04eb959b5b2e3fe3a35c352b85 /vcl/generic/glyphs/gcach_ftyp.cxx
parent6a0f957968bab9f72295ad17d5d1b77aecef2d75 (diff)
coverity#735339 Unchecked return value from library
Change-Id: Ia6567cb6f779669c738469ba68b7ad675e99d71a
Diffstat (limited to 'vcl/generic/glyphs/gcach_ftyp.cxx')
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index d6017db55f7a..42be83680f3b 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -172,7 +172,12 @@ bool FtFontFile::Map()
return false;
struct stat aStat;
- fstat( nFile, &aStat );
+ int nRet = fstat( nFile, &aStat );
+ if (nRet < 0)
+ {
+ close (nFile);
+ return false;
+ }
mnFileSize = aStat.st_size;
mpFileMap = (const unsigned char*)
mmap( NULL, mnFileSize, PROT_READ, MAP_SHARED, nFile, 0 );