Hello,

I'm investigating some cppcheck findings, for example:

[src/openvpn/buffer.c:442] -> [src/openvpn/buffer.c:447]: (warning) Either
the condition 'if(separator&&i&&!(i%(space_break_flags&255)))' is redundant
or there is possible null pointer dereference: separator.
[src/openvpn/buffer.c:443] -> [src/openvpn/buffer.c:447]: (warning) Either
the condition 'if(separator&&i&&!(i%(space_break_flags&255)))' is redundant
or there is possible null pointer dereference: separator.


as I see, there's call to format_hex_ex with separator=NULL here:


https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/ssl_openssl.c#L152

which in turn should be segfault in strlen:

https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/buffer.c#L442

(if maxoutput is not zero)

should we add some check here ?


Cheers,
Ilya Shipitsin

Reply via email to