Control parsing incorrect if criticality field ommitted

This commit is contained in:
Mark Cavage 2011-12-06 13:56:20 -08:00 committed by Mathieu Lecarme
parent 4cf4291c5b
commit 7b5bef86d5
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ Control.prototype.parse = function(ber) {
if (ber.length) {
this.type = ber.readString();
if (ber.offset < end)
this.criticality = ber.readBoolean();
if (ber.offset < end) {
if (ber.peek() === 0x01) // Boolean, optional
this.criticality = ber.readBoolean();
}
if (ber.offset < end)
this.value = ber.readString();