[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: vsnprintf - segement fault

From: Lemley James - jlemle
Subject: RE: vsnprintf - segement fault
Date: Thu, 27 Apr 2006 11:34:31 -0500

You have the wrong list; this is bug-coreutils which deals with the
coreutils package.  If you suspect you have a glibc bug, there is a list
called bug-glibc.  

Now that that is out of the way, here's an answer:  

It is not a bug, but %n is causing vsprintf to expect an argument where
you have passed none.  

What you have written looks to me like the equivalent of: 
printf ("%n"); 
which of course won't work because you haven't passed another parameter.
See the man page for vsprintf: %n is special, and requires an int
pointer as a paramter. 

If you want any string to work with your function, try calling it like
Dump("%s", "Will cause segment fault -- %n");

That, or double up your percent signs if you want a literal percent
Dump("Will cause segment fault -- %%n");


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Kalle Skott
Sent: Thursday, April 27, 2006 7:41 AM
To: address@hidden
Subject: vsnprintf - segement fault

This small code snippet will cause a segment fault in:

The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]