Update of /cvsroot/netrek/client/cow
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25514

Modified Files:
	ChangeLog parsemeta.c 
Log Message:
fix segfault

Index: parsemeta.c
===================================================================
RCS file: /cvsroot/netrek/client/cow/parsemeta.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- parsemeta.c	22 Feb 2006 22:55:22 -0000	1.9
+++ parsemeta.c	14 Apr 2006 10:29:40 -0000	1.10
@@ -1,6 +1,9 @@
 /* meta.c
  * 
  * $Log$
+ * Revision 1.10  2006/04/14 10:29:40  quozl
+ * fix segfault
+ *
  * Revision 1.9  2006/02/22 22:55:22  quozl
  * fix ReadMetasRecv regression
  *
@@ -420,7 +423,7 @@
 
 static void version_r(struct sockaddr_in *address) {
   char *p;
-  int servers, i, j;
+  int servers, i;
   time_t now = time(NULL);
 
   /* number of servers */
@@ -440,8 +443,6 @@
 
   if (servers == 0) return;
 
-  grow(servers);
-
   /* for each server listed by this metaserver packet */
   for(i=0;i<servers;i++) {
     struct servers *sp = NULL;
@@ -509,13 +510,14 @@
       }
     } else {
       /* not found, store it at the end of the list */
-      sp = serverlist + j;
+      grow(1);
+      sp = serverlist + num_servers;
+      num_servers++;
       strncpy(sp->address,host,LINE);
       sp->port = port;
       sp->age = age;
       sp->when = now;
       sp->lifetime = 4;
-      num_servers++;
     }
     sp->refresh = 1;
 

Index: ChangeLog
===================================================================
RCS file: /cvsroot/netrek/client/cow/ChangeLog,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ChangeLog	1 Mar 2006 07:16:03 -0000	1.25
+++ ChangeLog	14 Apr 2006 10:29:40 -0000	1.26
@@ -1,3 +1,8 @@
+Fri Apr 14 20:26:45 2006  James Cameron  <quozl at us.netrek.org>
+
+	* parsemeta.c (version_r): fix growth of server list.
+	Reported by: Stephen Thorne.
+
 Wed Mar  1 18:08:33 2006  James Cameron  <quozl at us.netrek.org>
 
 	* netrek-client-cow-3.2.0: released.