Skip to content

Commit

Permalink
APER - Check that calculated rawLength is not zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Janusz Majnert committed Jan 3, 2024
1 parent 91811b3 commit 46cd063
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/asn1/aper/aper.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ func (pd *perBitData) parseInteger(extensed bool, lowerBoundPtr *int64, upperBou
rawLength = uint(pd.bytes[pd.byteOffset])
pd.byteOffset++
log.Debugf("%s", perBitLog(8, pd.byteOffset, pd.bitsOffset, uint64(rawLength)))
if rawLength == 0 {
err := fmt.Errorf("rawLength cannot be 0")
return int64(0), err
}
} else if valueRange <= 65536 {
rawValue, err := pd.parseConstraintValue(valueRange)
if err != nil {
Expand Down

0 comments on commit 46cd063

Please sign in to comment.