From: didg Date: Mon, 2 Feb 2009 10:24:28 +0000 (+0000) Subject: check buffer size X-Git-Tag: before_acls~1 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=7f95a47243bbf7e5500bbb10650d118b72845b10 check buffer size --- diff --git a/etc/papd/ppd.c b/etc/papd/ppd.c index 786ee9c6..e80b4a77 100644 --- a/etc/papd/ppd.c +++ b/etc/papd/ppd.c @@ -1,5 +1,5 @@ /* - * $Id: ppd.c,v 1.14 2009-01-21 04:04:20 didg Exp $ + * $Id: ppd.c,v 1.15 2009-02-02 10:24:28 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -289,6 +289,9 @@ struct ppd_feature *ppd_feature( feature, len ) } #endif /* SHOWPPD */ + if (len > sizeof(ppd_feature_main) -1) + return( NULL ); + for ( end = feature + len, p = feature, q = ppd_feature_main; (p <= end) && (*p != '\n') && (*p != '\r'); p++, q++ ) { *q = *p;