Bug in talloc_asprintf_append()

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Sep 14 16:34:11 GMT 2007


On Wed, Sep 12, 2007 at 02:15:40PM -0700, Jeremy Allison wrote:
> > 	/* talloc a 10 byte string. */
> > 	char *s = talloc_strdup(NULL, "0123456789");
> > 
> > 	s[5] = '\0';
> > 
> > 	s = talloc_asprintf_append(s,
> > 				"%s",
> > 				"56789");

Sorry, but this is an illegal use of that API. This was
meant to handle huge strings in winbind for the extra_data
stuff efficiently without having to go over the existing
string over and over again. If you keep it this way, I will
add a function that does exactly what talloc_asprintf_append
did before.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20070914/fade059f/attachment.bin


More information about the samba-technical mailing list