Remove bad varint check

This commit is contained in:
Emery Hemingway 2023-09-13 09:37:47 +02:00
parent 15390dd48e
commit ab3bd12c11
2 changed files with 1 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# Package # Package
version = "20230912" version = "20230913"
author = "Emery Hemingway" author = "Emery Hemingway"
description = "data model and serialization format" description = "data model and serialization format"
license = "Unlicense" license = "Unlicense"

View File

@ -537,7 +537,6 @@ proc readVarint(s: Stream): uint =
var var
shift = 0 shift = 0
c = uint s.readUint8 c = uint s.readUint8
if c == 0x80: raise newException(ValueError, "invalid Preserves data")
while (c and 0x80) == 0x80: while (c and 0x80) == 0x80:
result = result or ((c and 0x7f) shl shift) result = result or ((c and 0x7f) shl shift)
inc(shift, 7) inc(shift, 7)