Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 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 <gray@Mirddin.farlep.net>.
  • Loading branch information
Ulrich Drepper committed Apr 22, 2006
1 parent 41a3975 commit 9055724
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2006-04-21 Jakub Jelinek <jakub@redhat.com>

* 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 <gray@Mirddin.farlep.net>.

2006-04-21 Ulrich Drepper <drepper@redhat.com>

[BZ #2534, BZ #2535]
Expand Down
5 changes: 3 additions & 2 deletions argp/argp.h
@@ -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 <miles@gnu.ai.mit.edu>.
Expand All @@ -24,6 +24,7 @@
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
#include <limits.h>

#define __need_error_t
#include <errno.h>
Expand Down Expand Up @@ -574,7 +575,7 @@ __NTH (__option_is_short (__const struct argp_option *__opt))
else
{
int __key = __opt->key;
return __key > 0 && isprint (__key);
return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
}
}

Expand Down

0 comments on commit 9055724

Please sign in to comment.