Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4656) more uninitialized network data
Home

[Freeciv-Dev] Re: (PR#4656) more uninitialized network data

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4656) more uninitialized network data
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jul 2003 12:52:04 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:
> There's only one place in the server where send_packet_generic_message 
> sends uninitialized data.

And here's a version that will actually compile.

jason

Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.107
diff -u -r1.107 sernet.c
--- server/sernet.c     2003/07/10 03:34:30     1.107
+++ server/sernet.c     2003/07/23 19:51:13
@@ -61,6 +61,7 @@
 #endif
 
 #include "capability.h"
+#include "events.h"
 #include "fcintl.h"
 #include "log.h"
 #include "mem.h"
@@ -204,9 +205,11 @@
 void close_connections_and_socket(void)
 {
   int i;
-
   struct packet_generic_message gen_packet;
+
   gen_packet.message[0]='\0';
+  gen_packet.x = gen_packet.y = -1;
+  gen_packet.event = E_NOEVENT;
 
   lsend_packet_generic_message(&game.all_connections, PACKET_SERVER_SHUTDOWN,
                               &gen_packet);

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