+-- On Tue, 6 Nov 2018, Philippe Mathieu-Daudé wrote --+ | > @@ -113,6 +113,7 @@ static void vhci_host_send(void *opaque, | > static uint8_t buf[4096]; | > | > buf[0] = type; | > + assert(len <= sizeof(buf) - 1); | | Why not simply "assert(len < sizeof(buf));"?
| > for (;;) { | > int cnt = MIN(len, s->in_needed - s->in_len); | > - if (cnt) { | > + if (cnt > 0) { | | Shouldn't we assert here? Yes, sent revised patch v2. Thank you. -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F