[strongSwan-dev] [PATCH] socket-default: fix use of uninitialized memory when forcing source address on outgoing packet.

Dmitry Shubin shubin at rnd.stcnet.ru
Fri Oct 30 23:07:11 CET 2015


On 2015-10-30 20:27, Maxime Bizon wrote:
> not to mention that max buf size is dynamic (it depends on address
> family)
You're right. Somehow I have completely overlooked the possibility of 
two buffers coexisting at the same time.

Just for fun I've tried to untangle all the ifdefs and factored the code 
out into three separate functions. This way it's a bit easier to follow 
at a slight cost SLOC-wise. Have a look:
https://github.com/dmsh/strongswan/tree/draft/socket-default-refactoring
Caveat: it compiles on linux, but I haven't done any testing.



More information about the Dev mailing list