The following commit has been merged in the master branch: commit 4dd4a9d4daf9dd3b5398415f0726bf1dbd298053 Author: Marek Lindner lindner_marek@yahoo.de Date: Sat Apr 7 12:52:02 2007 +0200
send gateway class with vis packet - fix buffer overwrite
diff --git a/batman.c b/batman.c index eb7462a..63a43f0 100644 --- a/batman.c +++ b/batman.c @@ -544,9 +544,10 @@ void send_vis_packet() { } if(packet != NULL) { - packet = debugRealloc(packet, ( size * sizeof(unsigned char) ) + 1, 114); - *(packet + size + 1) = gateway_class; - send_packet(packet, ( size * sizeof(unsigned char) ) + 1, &vis_if.addr, vis_if.sock); + size++; + packet = debugRealloc(packet, size * sizeof(unsigned char), 114); + *(packet + size - 1) = gateway_class; + send_packet(packet, size * sizeof(unsigned char), &vis_if.addr, vis_if.sock); debugFree( packet, 1102 ); } }