RE: [PATCH net] sctp: prevent info leak in sctp_make_heartbeat()

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

 



> > -	struct sctp_sender_hb_info hbinfo;
> > +	struct sctp_sender_hb_info hbinfo = {};

> Does that gcc extension work with all compilers, especially clang?

> > So that's nice, because adding memset()s to zero everywhere was ugly.

The 'real fun' (tm) starts when the bit pattern for the NULL
pointer isn't 'all zeros'.
Using memset() is then broken - I suspect the compiler is
expected to initialise pointers to the correct NULL pattern.

Not that I think anyone sane would consider trying to compile
any 'normal' C code for such a system.

OTOH it is probably why clang is bleating about (int)((char *)0 + 4)
being undefined behaviour.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)




[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux