[Bug libc/13303] strange crash in 64bit vsnprintf()
aj at suse dot de
sourceware-bugzilla@sourceware.org
Mon Oct 17 07:45:00 GMT 2011
http://sourceware.org/bugzilla/show_bug.cgi?id=13303
Andreas Jaeger <aj at suse dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |aj at suse dot de
Resolution| |INVALID
--- Comment #1 from Andreas Jaeger <aj at suse dot de> 2011-10-17 07:44:33 UTC ---
Your code is buggy, vsnprintf uses the args and you need to reset it.
va_list args;
va_start( args, params );
char buffer[0x4000];
unsigned int required = vsnprintf( buffer, sizeof(buffer), params, args );
Add va_end (args);va_start(args,params); here
char *bigbuffer = (char*)malloc( required + 1 );
vsnprintf( bigbuffer, required + 1, params, args );
va_end( args );
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list