From: srittau Date: Tue, 18 Mar 2003 23:39:18 +0000 (+0000) Subject: Backport from HEAD: X-Git-Tag: netatalk-1-6-2rc1~7 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0520de0907da1881e91a01f184f8f91e403fc66d;hp=8b428e29a9603f2147884a3a970738fdd79157cc;p=netatalk.git Backport from HEAD: * FIX: atalkd: Fixes for reading long configuration file lines. [Dan Wilga] --- diff --git a/NEWS b/NEWS index 10a2378b..a9377fbc 100644 --- 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 ================ diff --git a/etc/atalkd/config.c b/etc/atalkd/config.c index d3dce8a2..076b74c2 100644 --- a/etc/atalkd/config.c +++ b/etc/atalkd/config.c @@ -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;