gracefully handle parsing attributes with no values

This commit is contained in:
Mark Cavage 2011-09-23 15:47:02 -07:00
parent e0c7fc4027
commit c57470804c
1 changed files with 6 additions and 6 deletions

View File

@ -71,12 +71,12 @@ Attribute.prototype.parse = function(ber) {
ber.readSequence();
this.type = ber.readString().toLowerCase();
if (ber.readSequence(Protocol.LBER_SET)) {
var end = ber.offset + ber.length;
while (ber.offset < end)
this.vals.push(ber.readString());
if (ber.peek() === Protocol.LBER_SET) {
if (ber.readSequence(Protocol.LBER_SET)) {
var end = ber.offset + ber.length;
while (ber.offset < end)
this.vals.push(ber.readString());
}
}
return true;