if ((res = ber_declen(b, &len, max)) < 0)
return -1;
if (len+res > max || len < 0) /* out of bounds or indefinite encoding */
if ((res = ber_declen(b, &len, max)) < 0)
return -1;
if (len+res > max || len < 0) /* out of bounds or indefinite encoding */