Merge pull request #410 from guzba/master

check for int overflow
This commit is contained in:
treeform 2022-03-29 18:01:42 -07:00 committed by GitHub
commit df531a4e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1623,6 +1623,9 @@ proc fillShapes(
if pathWidth == 0:
return
if pathWidth < 0:
raise newException(PixieError, "Path int overflow detected")
var
coverages = newSeq[uint8](pathWidth)
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
@ -1689,6 +1692,9 @@ proc fillShapes(
if pathWidth == 0:
return
if pathWidth < 0:
raise newException(PixieError, "Path int overflow detected")
var
coverages = newSeq[uint8](pathWidth)
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)