talloc_asprintf dumping the length?

Andrew Bartlett abartlet at samba.org
Sun Aug 13 23:02:04 GMT 2006


On Sun, 2006-08-13 at 22:57 +0000, David Collier-Brown wrote:
> cat >x.c <<!
> #include <stdio.h>
> main() {
>          printf("%s\n", NULL);
> }
> !
> froggy> cc x.c
> "x.c", line 2: warning: old-style declaration or incorrect type for: main
> froggy> ./a.out
> Segmentation Fault
> froggy>
> 
> I'm not entirely sure that's safe (:-))

Our configure tests are meant to detect that (if they don't, it's a bug)
and replace the printf() in that case.  (Actually, I think it only
replaces snprintf() and asprintf(), but they are the main ones we
actually use).

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060814/e3d3ab34/attachment.bin


More information about the samba-technical mailing list