Avoid undefined behaviour in PACKET_buf_init
authorMatt Caswell <matt@openssl.org>
Wed, 21 Oct 2015 09:00:24 +0000 (10:00 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 21 Oct 2015 15:13:53 +0000 (16:13 +0100)
commit3fde6c9276c9cd6e56e8e06e756350a4fbdd7031
tree0f2362240850565662ab8137268560c31dc51f7c
parent788d72ba021fdd29f6b3e573adc313d97f7d224d
Avoid undefined behaviour in PACKET_buf_init

Change the sanity check in PACKET_buf_init to check for excessive length
buffers, which should catch the interesting cases where len has been cast
from a negative value whilst avoiding any undefined behaviour.

RT#4094

Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/packet_locl.h