···412412 if (len !== null) {
413413 // definite length
414414 var end = start + len;
415415+ if (end > stream.enc.length)
416416+ throw 'Container at offset ' + start + ' has a length of ' + len + ', which is past the end of the stream';
415417 while (stream.pos < end)
416418 sub[sub.length] = ASN1.decode(stream);
417419 if (stream.pos != end)