X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fpapd%2Ffile.c;h=1517c0c380c1b2ba46c363473b6a2e1331957103;hb=534b741ef430de60ef088fe2fed0ae42e18dba02;hp=0339158cd2ae37e1854aa7000719f1d617f05cb1;hpb=644c7d4f1a295df818a7f8339ac750821e7c26dc;p=netatalk.git diff --git a/etc/papd/file.c b/etc/papd/file.c index 0339158c..1517c0c3 100644 --- a/etc/papd/file.c +++ b/etc/papd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.6 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: file.c,v 1.9.12.1 2009-02-03 08:25:00 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -9,7 +9,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -#include +#include #include #include #include @@ -17,6 +17,8 @@ #include "file.h" +/* +*/ int markline( pf, start, linelength, crlflength ) char **start; int *linelength, *crlflength; @@ -53,8 +55,15 @@ int markline( pf, start, linelength, crlflength ) (p[*crlflength]=='\r' || p[*crlflength]=='\n')) { (*crlflength)++; } + + if (!*crlflength) { + /* line is way too long, something fishy is going on, give up */ + LOG(log_error, logtype_papd, "markline: no crlf in comment, give up" ); + return( -2 ); + } - return *linelength; + /* success, return 1 */ + return( 1 ); } void morespace( pf, data, len )