Add warning about a potential pitfall with WPACKET_allocate_bytes()
authorMatt Caswell <matt@openssl.org>
Wed, 21 Sep 2016 10:20:18 +0000 (11:20 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 22 Sep 2016 22:12:38 +0000 (23:12 +0100)
commit4b0fc9fc7a8767f3e6289b2b9f4527db186b3566
treea1f727298be9f459f2900f4a681b3e7eebc31a6c
parentf3b3d7f0033080f86ede5a53e8af2fb313091b5a
Add warning about a potential pitfall with WPACKET_allocate_bytes()

If the underlying BUF_MEM gets realloc'd then the pointer returned could
become invalid. Therefore we should always ensure that the allocated
memory is filled in prior to any more WPACKET_* calls.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/packet.c
ssl/packet_locl.h