ntpd plugin: Fix buffer reallocation when the message is send in more than one packet.
authorLubos Stanek <lubek@users.sourceforge.net>
Sat, 4 Nov 2006 12:14:11 +0000 (13:14 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 4 Nov 2006 12:14:11 +0000 (13:14 +0100)
src/ntpd.c

index d65d1ed..5204270 100644 (file)
@@ -694,6 +694,7 @@ static int ntpd_receive_response (int req_code, int *res_items, int *res_size,
                                (items_num + pkt_item_num) * res_item_size);
                items = realloc ((void *) *res_data,
                                (items_num + pkt_item_num) * res_item_size);
+               items_num += pkt_item_num;
                if (items == NULL)
                {
                        items = *res_data;