]> git.ipfire.org Git - thirdparty/openvpn.git/commit
ntlm: avoid breaking anti-aliasing rules
authorAntonio Quartulli <antonio@openvpn.net>
Wed, 16 Aug 2017 12:18:06 +0000 (20:18 +0800)
committerDavid Sommerseth <davids@openvpn.net>
Wed, 16 Aug 2017 14:51:13 +0000 (16:51 +0200)
commite84b6994b4d2b53bcebd5415a58de4cecd411a7b
treeda531cc17c8f586f25a0ce765b0c3d8b0b60de86
parentaa9d3a5bdc5a1b395d37fbb8abb3ed6166856a1a
ntlm: avoid breaking anti-aliasing rules

The problem is visible when compiling with -O2:

ntlm.c: In function ‘ntlm_phase_3’:
ntlm.c:305:9: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
         if ((*((long *)&buf2[0x14]) & 0x00800000) == 0x00800000)

The spec suggests to interpret those 4 bytes as a long, but
this needs to be done carefully.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20170816121806.26471-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15268.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
src/openvpn/ntlm.c