Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 2b35039c8c1ba115b07be28dddfe38538e53d427 Author: Sven Eckelmann sven@open-mesh.com Date: Wed May 22 04:55:22 2013 -0700
alfred: Consume the whole received packet for NULL-data
A packet consisting of various data blocks with the last one only being a data frame without content would be ignored when the loop would expect at least sizeof(*data) + 1 bytes. This would make "clearing" data across different alfred nodes unreliable.
Signed-off-by: Sven Eckelmann sven@open-mesh.com
2b35039c8c1ba115b07be28dddfe38538e53d427 recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recv.c b/recv.c index 6292df0..7541632 100644 --- a/recv.c +++ b/recv.c @@ -46,7 +46,7 @@ static int finish_alfred_push_data(struct globals *globals, len -= sizeof(*push) - sizeof(push->header); pos = (uint8_t *)push->data;
- while (len > (int)sizeof(*data)) { + while (len >= (int)sizeof(*data)) { data = (struct alfred_data *)pos; data_len = ntohs(data->header.length);