From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15909 invoked by alias); 21 Apr 2006 12:56:07 -0000 Received: (qmail 15893 invoked by uid 22791); 21 Apr 2006 12:56:07 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Apr 2006 12:56:05 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k3LCtxIR028345; Fri, 21 Apr 2006 14:55:59 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k3LCtxTH028344; Fri, 21 Apr 2006 14:55:59 +0200 Date: Fri, 21 Apr 2006 12:56:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix argp.h __option_is_short Message-ID: <20060421125559.GB4651@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00008.txt.bz2 Hi! __key larger than 255 is valid in argp, but may crash in isprint. Fix grabbed from gnu-lib. 2006-04-21 Jakub Jelinek * argp/argp.h (__option_is_short): Check upper limit of __key. isprint() requires its argument to have the value of an unsigned char or EOF. Patch by Sergey Poznyakoff . --- libc/argp/argp.h.jj 2005-11-21 12:07:37.000000000 +0100 +++ libc/argp/argp.h 2006-04-21 14:41:39.000000000 +0200 @@ -1,5 +1,5 @@ /* Hierarchial argument parsing, layered over getopt. - Copyright (C) 1995-1999,2003,2004,2005 Free Software Foundation, Inc. + Copyright (C) 1995-1999,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -24,6 +24,7 @@ #include #include #include +#include #define __need_error_t #include @@ -574,7 +575,7 @@ __NTH (__option_is_short (__const struct else { int __key = __opt->key; - return __key > 0 && isprint (__key); + return __key > 0 && __key <= UCHAR_MAX && isprint (__key); } } Jakub