Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
epgdb: epg_init - fix possible negative value - coverity
  • Loading branch information
perexg committed Oct 3, 2014
1 parent 0cb7321 commit a0e4c01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/epgdb.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit a0e4c01

Please sign in to comment.