Bug#47684: vsnprintf broken in libc6 (powerppc)
On Mon, Oct 18, 1999 at 01:14:04AM +0100, Nuno Oliveira wrote:
> Package: libc6
> Version: 2.1.2-5
>
> I get SIGSEGVs at the vsnprintf call in the following code
> segment (this is from dump-0.4, on powerpc):
>
> void
> #ifdef __STDC__
> msg(const char *fmt, ...)
> #else
> msg(fmt, va_alist)
> char *fmt;
> va_dcl
> #ifdef __STDC__
> va_start(ap, fmt);
> #else
> va_start(ap);
> #endif
> (void) vfprintf(stderr, fmt, ap);
> (void) fflush(stdout);
> (void) fflush(stderr);
> (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap);
> va_end(ap);
> }
>
> The call to vfprintf just before is ok. Using libc_debug I get:
> This is probably related to bug #22541.
No, it's not. You're violating the usage of varargs. You need to call
va_end() again and va_start a second time between the two uses of ap.
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/
Reply to: