]> arthur.barton.de Git - netatalk.git/commitdiff
Backport from HEAD:
authorsrittau <srittau>
Tue, 18 Mar 2003 23:39:18 +0000 (23:39 +0000)
committersrittau <srittau>
Tue, 18 Mar 2003 23:39:18 +0000 (23:39 +0000)
* FIX: atalkd: Fixes for reading long configuration file lines. [Dan Wilga]

NEWS
etc/atalkd/config.c

diff --git a/NEWS b/NEWS
index 10a2378b682c400d2947cbc5ddd3bc94a9f18110..a9377fbca71699cb06cc4ede9894da77e7fa4808 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes in 1.6.2
 
 * FIX: macusers script can now cope with IP addresses instead of host names.
 * FIX: Install etc2ps.sh correctly.
+* FIX: atalkd: Fixes for reading long configuration file lines. [Dan Wilga]
 
 Changes in 1.6.1
 ================
index d3dce8a28a7b157e414b2ffb070db54f6f0c7717..076b74c253c13c0615d3ae4ec2681d4d825ed32f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.12 2002-09-29 23:24:47 sibaz Exp $
+ * $Id: config.c,v 1.12.2.1 2003-03-18 23:39:30 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -81,6 +81,7 @@ static struct param {
 };
 
 #define ARGV_CHUNK_SIZE 128
+#define MAXLINELEN 2048
 char **parseline(const char *line)
 {
     const char  *p;
@@ -136,7 +137,7 @@ char **parseline(const char *line)
        /* Make room for a NULL pointer and our special pointer (s.b.) */
        if ( (argc + 1) % ARGV_CHUNK_SIZE == 0 ) {
            char **tmp;
-           tmp = (char **) realloc( argv, argc + 1 + ARGV_CHUNK_SIZE );
+           tmp = (char **) realloc( argv, argc + 1 + ARGV_CHUNK_SIZE * sizeof( char * ) );
            if ( !tmp ) {
                /* FIXME: error handling */
                free( argv );
@@ -178,7 +179,7 @@ int writeconf( cf )
     char       *cf;
 {
     struct stat                st;
-    char               *path, *p, newpath[ MAXPATHLEN ], line[ 1024 ];
+    char               *path, *p, newpath[ MAXPATHLEN ], line[ MAXLINELEN ];
     char               **argv;
     FILE               *conf, *newconf;
     struct interface   *iface;
@@ -304,7 +305,7 @@ int readconf( cf )
 {
     struct ifreq       ifr;
     struct interface   *iface, *niface;
-    char               line[ 1024 ], **argv, *p;
+    char               line[ MAXLINELEN ], **argv, *p;
     int                        i, j, s, cc;
     FILE               *conf;