From 9aa52bb37e90a00fa38fb5048fd1debb599b03df Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 5 Aug 2022 12:39:24 +1200 Subject: pytest/segfault: abort for generate_random_bytes(-1) Signed-off-by: Douglas Bagnall Reviewed-by: Andreas Schneider --- python/samba/tests/segfault.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/samba') diff --git a/python/samba/tests/segfault.py b/python/samba/tests/segfault.py index 6186d60c823..a2a42feffda 100644 --- a/python/samba/tests/segfault.py +++ b/python/samba/tests/segfault.py @@ -236,3 +236,9 @@ class SegfaultTests(samba.tests.TestCase): c = ldb.Control(samdb, 'relax:1') del c.critical + + @segfault_detector + def test_random_bytes(self): + # memory error from SIZE_MAX -1 allocation. + from samba import generate_random_bytes + generate_random_bytes(-1) -- cgit v1.2.3