From: didg Date: Tue, 7 Jan 2003 22:13:39 +0000 (+0000) Subject: check input sindex >=1. X-Git-Tag: netatalk-2-0-alpha1~283 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=2ae3c77b36071b30c5ecf65d924524225cd67ae6 check input sindex >=1. --- diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index fd1e514a..3e6eb96e 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -1,5 +1,5 @@ /* - * $Id: enumerate.c,v 1.28 2002-12-23 00:21:35 didg Exp $ + * $Id: enumerate.c,v 1.29 2003-01-07 22:13:39 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -288,7 +288,12 @@ int ext; sindex = ntohs( temp16 ); ibuf += sizeof( temp16 ); } - + + if (!sindex) { + *rbuflen = 0; + return AFPERR_PARAM ; + } + if (ext == 2) { memcpy( &maxsz, ibuf, sizeof( maxsz )); maxsz = ntohl( maxsz );