Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
capmt: fix endless loop
When tvh receives less then 4 bytes from the socket for some reason,
it stuck in the endless loop in handle_single() calling:
capmt_msg_size()
capmt_analyze_cmd()
The capmt thread eats 100% CPU and cannot be normally terminated
because the capmt_msg_size() was constantly returning 0.

The commit fixes the problem.
  • Loading branch information
manio authored and perexg committed Mar 22, 2015
1 parent 7414eba commit ac3599b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/descrambler/capmt.c
Expand Up @@ -1372,7 +1372,7 @@ handle_single(capmt_t *capmt)
}
if (adapter < MAX_CA) {
cmd_size = capmt_msg_size(capmt, &buffer, offset);
if (cmd_size >= 0)
if (cmd_size > 0)
break;
}
sbuf_cut(&buffer, 1);
Expand Down

0 comments on commit ac3599b

Please sign in to comment.