From fe630227f24e0f6604d83563d36747347cfcd417 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Tue, 31 Jul 2012 10:07:18 +0200 Subject: [PATCH] kino/filehandler.cc: check return value from lseek() Fixes Coverity CID 709329: Unchecked return value (CHECKED_RETURN) Calling function "lseek" without checking return value (as is done elsewhere 19 out of 20 times). No check of the return value of "lseek(this->fd, 0L, 0)". 409 lseek( fd, 0, SEEK_SET ); --- src/modules/kino/filehandler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/kino/filehandler.cc b/src/modules/kino/filehandler.cc index bae33e0b..ad964b49 100644 --- a/src/modules/kino/filehandler.cc +++ b/src/modules/kino/filehandler.cc @@ -411,7 +411,8 @@ bool RawHandler::Open( const char *s ) return false; if ( read( fd, data, 4 ) < 0 ) return false; - lseek( fd, 0, SEEK_SET ); + if ( lseek( fd, 0, SEEK_SET ) < 0 ) + return false; numBlocks = ( ( data[ 3 ] & 0x80 ) == 0 ) ? 250 : 300; filename = s; return true; -- 2.39.5