From: Jaroslav Kysela Date: Fri, 3 Oct 2014 15:29:24 +0000 (+0200) Subject: epgdb: epg_init - fix possible negative value - coverity X-Git-Tag: v4.1~1170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0e4c0133c43dbfca1fe15ba18b09c5f04efd428;p=thirdparty%2Ftvheadend.git epgdb: epg_init - fix possible negative value - coverity --- diff --git a/src/epgdb.c b/src/epgdb.c index 4a3dabcc7..32d9adb19 100644 --- a/src/epgdb.c +++ b/src/epgdb.c @@ -185,12 +185,12 @@ void epg_init ( void ) while ( remain > 4 ) { /* Get message length */ - int msglen = (rp[0] << 24) | (rp[1] << 16) | (rp[2] << 8) | rp[3]; + uint32_t msglen = (rp[0] << 24) | (rp[1] << 16) | (rp[2] << 8) | rp[3]; remain -= 4; rp += 4; /* Safety check */ - if (msglen > remain) { + if ((int64_t)msglen > remain) { tvhlog(LOG_ERR, "epgdb", "corruption detected, some/all data lost"); break; }