asn1: Fix binary search off-by-one read
commitb8f89068222a5b5988cecff13f9d9509fefa91eb
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sun, 12 Dec 2021 23:04:58 +0000 (13 12:04 +1300)
committerNico Williams <nico@cryptonector.com>
Tue, 14 Dec 2021 01:18:24 +0000 (13 19:18 -0600)
tree8bb84aa62e5a543a3d996e4eeee3d7bfe05da8c2
parentd8af2eb730191008e0c628ec5023176b6fc388ca
asn1: Fix binary search off-by-one read

Previously, if left==right==A1_HEADER_LEN(tos), this would read past the
end of the template array. Now we treat [left, right) as a half-open
interval and no longer try to read from 'right'.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
lib/asn1/template.c