qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1] bt: use size_t type for length parameters in


From: P J P
Subject: Re: [Qemu-devel] [PATCH v1] bt: use size_t type for length parameters instead of int
Date: Mon, 19 Nov 2018 16:44:29 +0530 (IST)

+-- 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]