Skip to content

Commit f107fe9

Browse files
committed
More fixes discovered by fuzzing
1 parent 6a7652a commit f107fe9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/array.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(dimensions (loop repeat array-rank
1010
collect (restore-tagged-unsigned-fixnum storage)))
1111
(displaced (funcall restore-object))
12-
(array-total-size (reduce #'* dimensions)))
12+
(array-total-size (if dimensions (reduce #'* dimensions) 0)))
1313
(unless (and (typep array-total-size 'fixnum) (>= array-total-size 0))
1414
(unexpected-data "Array total size is too large"))
1515
(check-if-too-much-data (read-storage-max-to-read storage) array-total-size)

test/cl-binary-store-tests.lisp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,16 @@
705705
;; The below is a non-fixnum claiming to be in a fixnum array
706706
(finish
707707
(handler-case
708-
(cl-binary-store::restore #(21 5 3 127 127 127 127 127 127 127 127))
708+
(restore #(21 5 3 127 127 127 127 127 127 127 127))
709709
(invalid-input-data ())))
710710
(finish
711711
(handler-case
712-
(cl-binary-store::restore #(21 5 3 127 127 127 127 127 127 127 127))
712+
(restore #(21 5 3 127 127 127 127 127 127 127 127))
713713
(invalid-input-data ()))))
714714

715+
716+
(define-test other-fuzzing-tests
717+
(finish
718+
(handler-case
719+
(restore #(24 53 197 0 44 60 123 20))
720+
(invalid-input-data ()))))

0 commit comments

Comments
 (0)