The assumption in asn1_type() that an ASN.1 cursor will always contain a type byte is incorrect. A cursor that has been cleanly invalidated via asn1_invalidate_cursor() will contain a type byte, but there are other ways in which to arrive at a zero-length cursor. Fix by explicitly checking the cursor length in asn1_type(). This allows asn1_invalidate_cursor() to be reduced to simply zeroing the length field. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
81 |
|
81 |
|
82 |
|
82 |
|
83 |
|
83 |
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
84 |
|
97 |
|
85 |
|
98 |
|
86 |
|
|
|
||
314 |
|
314 |
|
315 |
|
315 |
|
316 |
|
316 |
|
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
|
320 |
|
|
|
321 |
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
|
|
|
325 |
|
|
|
326 |
|
|
317 |
|
327 |
|
318 |
|
328 |
|
319 |
|
329 |
|
320 |
|
330 |
|
321 |
|
|
|
|
331 |
|
|
322 |
|
332 |
|
323 |
|
333 |
|
324 |
|
334 |
|
325 |
|
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
|
|
326 |
|
338 |
|
327 |
|
339 |
|
328 |
|
340 |
|