lib:util: Fix undefined behavior in asn1 parser