* elf/ldconfig.c (main): Use rawmemchr instead of strchr.

* nis/nis_call.c (rec_dirsearch): Likewise.
	* nis/nis_local_names.c (nis_local_host): Likewise.
	(nis_local_directory): Likewise.
	* intl/explodename.c (_nl_explode_name): Likewise.

	* sysdeps/generic/unwind-dw2.c (execute_cfa_program): Don't handle
	DW_CFA_GNU_windiw_save if it obviously cannot work [Coverity CID 102].

	* locale/programs/ld-address.c (address_finish): Fix conditions
	for error messages [Coverity CID 104].
This commit is contained in:
Ulrich Drepper 2006-04-07 07:02:20 +00:00
parent 0292b0dd6c
commit 616d91335a
7 changed files with 33 additions and 13 deletions

View File

@ -1,5 +1,17 @@
2006-04-06 Ulrich Drepper <drepper@redhat.com>
* elf/ldconfig.c (main): Use rawmemchr instead of strchr.
* nis/nis_call.c (rec_dirsearch): Likewise.
* nis/nis_local_names.c (nis_local_host): Likewise.
(nis_local_directory): Likewise.
* intl/explodename.c (_nl_explode_name): Likewise.
* sysdeps/generic/unwind-dw2.c (execute_cfa_program): Don't handle
DW_CFA_GNU_windiw_save if it obviously cannot work [Coverity CID 102].
* locale/programs/ld-address.c (address_finish): Fix conditions
for error messages [Coverity CID 104].
* libio/fmemopen.c (fmemopen): Free stream memory in case of
invalid length [Coverity CID 106].

View File

@ -1194,7 +1194,7 @@ main (int argc, char **argv)
if (opt_chroot)
{
/* Normalize the path a bit, we might need it for printing later. */
char *endp = strchr (opt_chroot, '\0');
char *endp = rawmemchr (opt_chroot, '\0');
while (endp > opt_chroot && endp[-1] == '/')
--endp;
*endp = '\0';

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 1995-2002, 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@ -78,7 +78,7 @@ _nl_explode_name (name, language, modifier, territory, codeset,
if (*language == cp)
/* This does not make sense: language has to be specified. Use
this entry as it is without exploding. Perhaps it is an alias. */
cp = strchr (*language, '\0');
cp = __rawmemchr (*language, '\0');
else if (cp[0] != '@')
{
if (cp[0] == '_')

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998-2002, 2005 Free Software Foundation, Inc.
/* Copyright (C) 1998-2002, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -222,14 +222,18 @@ No definition for %s category found"), "LC_ADDRESS"));
if (address->lang_ab == NULL)
{
if (iso639[cnt].ab[0] != '\0' && verbose && ! nothing)
if ((cnt == sizeof (iso639) / sizeof (iso639[0])
|| iso639[cnt].ab[0] != '\0')
&& verbose && ! nothing)
WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' not defined"),
"LC_ADDRESS", "lang_ab"));
address->lang_ab = "";
}
else if (address->lang_ab[0] == '\0')
{
if (iso639[cnt].ab[0] != '\0' && verbose)
if ((cnt == sizeof (iso639) / sizeof (iso639[0])
|| iso639[cnt].ab[0] != '\0')
&& verbose)
WITH_CUR_LOCALE (error (0, 0, _("%s: field `%s' must not be empty"),
"LC_ADDRESS", "lang_ab"));
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
/* Copyright (C) 1997,1998,2001,2004,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@ -428,7 +428,7 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status)
return dir;
}
cp = strchr (leaf, '\0');
cp = rawmemchr (leaf, '\0');
*cp++ = '.';
strcpy (cp, domain);

View File

@ -1,4 +1,4 @@
/* Copyright (c) 1997, 1998, 2004 Free Software Foundation, Inc.
/* Copyright (c) 1997, 1998, 2004, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@ -63,7 +63,7 @@ nis_local_directory (void)
__nisdomainname[0] = '\0';
else
{
char *cp = strchr (__nisdomainname, '\0');
char *cp = rawmemchr (__nisdomainname, '\0');
/* Missing trailing dot? */
if (cp[-1] != '.')
@ -154,7 +154,7 @@ nis_local_host (void)
__nishostname[0] = '\0';
else
{
char *cp = strchr (__nishostname, '\0');
char *cp = rawmemchr (__nishostname, '\0');
int len = cp - __nishostname;
/* Hostname already fully qualified? */

View File

@ -1,5 +1,5 @@
/* DWARF2 exception handling and frame unwind runtime interface routines.
Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005
Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -897,12 +897,16 @@ execute_cfa_program (const unsigned char *insn_ptr,
break;
case DW_CFA_GNU_window_save:
/* ??? Hardcoded for SPARC register window configuration. */
/* ??? Hardcoded for SPARC register window configuration.
At least do not do anything for archs which explicitly
define a lower register number. */
#if DWARF_FRAME_REGISTERS < 32
for (reg = 16; reg < 32; ++reg)
{
fs->regs.reg[reg].how = REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *);
}
#endif
break;
case DW_CFA_GNU_args_size: