asn1: check overflow against SIZE_MAX not +1
commita5da5bcb96df0adc2e8bf2af5611db40b1f4845e
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 21 Jun 2014 00:15:13 +0000 (20 20:15 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 21 Jun 2014 00:15:13 +0000 (20 20:15 -0400)
treed75aa80425223af5108d1fdf0312e22ee80c15de
parent5fd158db474838c3e2fa7e50c2920fdb771c3a51
asn1: check overflow against SIZE_MAX not +1

A comparison of (len > len + 1) is permitted to be optimized out
as dead code because it can't be true.  Overflowing is an exceptional
condition that results in undefined behavior.  The correct conditional
is (len == SIZE_MAX) when len is size_t.

Change-Id: Ia5586556a973d9fa5228430c4304ea9792c996bb
lib/asn1/der_get.c