freebsd-ports/games/teeworlds/files/patch-e_network.c
Dmitry Marakasov 7bc09b0e83 - Fix possible server segfaults
PR:		148081
Submitted by:	David DEMELIER <demelier.david@gmail.com>
Feature safe:	yes
2010-06-23 16:38:57 +00:00

15 lines
433 B
C

--- src/engine/e_network.c.orig 2010-06-23 09:39:36.000000000 +0200
+++ src/engine/e_network.c 2010-06-23 09:41:29.000000000 +0200
@@ -224,6 +224,12 @@
if(packet->flags&NET_PACKETFLAG_CONNLESS)
{
+ /* check the size of connless packet */
+ if(size < 6)
+ {
+ dbg_msg("", "connless packet too small, %d", size);
+ return -1;
+ }
packet->flags = NET_PACKETFLAG_CONNLESS;
packet->ack = 0;
packet->num_chunks = 0;