This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: libc/1084: a variable miss initialized in mbsrtowcs
- To: Shinya Hanataka <hanataka@abyss.rim.or.jp>
- Subject: Re: libc/1084: a variable miss initialized in mbsrtowcs
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 19 Apr 1999 08:23:57 +0200
- Cc: bugs@gnu.org, libc-alpha@cygnus.com
- Mail-Copies-To: never
- References: <199904181859.DAA03375@abyss.rim.or.jp>
>>>>> Shinya Hanataka writes:
>> Submitter-Id: net
>> Originator: Shinya Hanataka
>> Organization: no
>> Confidential: no
>> Synopsis: a variable miss initialized in mbsrtowcs
>> Description:
> In mbsrtowcs, with dst=NULL, data.outbufend is miss initialized,
> because that data.outbuf is not initialized yet.
> This cause endless loop in some environment.
Thanks. Ulrich fixed this slightly different. The patch will be in
glibc 2.1.1.
Andreas
1999-04-18 Ulrich Drepper <drepper@cygnus.com>
* wcsmbs/mbsrtowcs.c (__mbsrtowcs): Correctly initialize outbufend
for dst==NULL.
Fixes PR libc/1084.
Index: wcsmbs/mbsrtowcs.c
===================================================================
--- mbsrtowcs.c 1999/03/15 20:40:25 1.16
+++ mbsrtowcs.c 1999/04/18 17:10:19 1.17
@@ -1,6 +1,6 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
+ Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -61,7 +61,7 @@
const unsigned char *inbuf = (const unsigned char *) *src;
const unsigned char *srcend = inbuf + strlen (inbuf) + 1;
- data.outbufend = data.outbuf + sizeof (buf);
+ data.outbufend = (char *) buf + sizeof (buf);
do
{
data.outbuf = (char *) buf;
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de