Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#9949) reject_new_connection is buggy
Home

[Freeciv-Dev] Re: (PR#9949) reject_new_connection is buggy

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9949) reject_new_connection is buggy
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 5 Sep 2004 11:48:45 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9949 >

Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9949 >
> 
> ==14224== Conditional jump or move depends on uninitialised value(s)
> ==14224==    at 0x1B90478B: strlen (mac_replace_strmem.c:189)
> ==14224==    by 0x80C0BBE: dio_put_string (dataio.c:327)
> ==14224==    by 0x80CCB03: send_packet_server_join_reply_100 
> (packets_gen.c:1187)
> ==14224==    by 0x80CCD3C: send_packet_server_join_reply 
> (packets_gen.c:1245)
> ==14224==    by 0x806CD0F: reject_new_connection (connecthand.c:194)
> ==14224==    by 0x806D100: handle_login_request (connecthand.c:268)
> ==14224==    by 0x804F883: handle_packet_input (srv_main.c:892)
> ==14224==    by 0x80A5E42: sniff_packets (sernet.c:616)
> ==14224==    by 0x8050B09: srv_loop (srv_main.c:1606)
> ==14224==    by 0x8050A06: srv_main (srv_main.c:1565)
> ==14224==    by 0x804A719: main (civserver.c:170)
> 
> The reason is the challenge_file field is unset.  This is a potentially 
> fatal error for the server.

Oops, looks like there's another unitialized field in this packet.

jason

Index: server/connecthand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/connecthand.c,v
retrieving revision 1.23
diff -u -r1.23 connecthand.c
--- server/connecthand.c        3 Sep 2004 02:48:34 -0000       1.23
+++ server/connecthand.c        5 Sep 2004 18:47:51 -0000
@@ -191,6 +191,8 @@
   packet.you_can_join = FALSE;
   sz_strlcpy(packet.capability, our_capability);
   sz_strlcpy(packet.message, msg);
+  packet.challenge_file[0] = '\0';
+  packet.conn_id = -1;
   send_packet_server_join_reply(pconn, &packet);
   freelog(LOG_NORMAL, _("Client rejected: %s."), conn_description(pconn));
   flush_connection_send_buffer_all(pconn);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9949) reject_new_connection is buggy, Jason Short <=