Skip to content

Commit 87af9d5

Browse files
Fix test_buffer_overflow with new ASan options
1 parent f568688 commit 87af9d5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Lib/test/test_capi/test_mem.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import re
23
import textwrap
34
import unittest
@@ -188,10 +189,12 @@ class PyMemDefaultTests(PyMemDebugTests):
188189
'need address sanitizer')
189190
class AddressSanitizerTests(unittest.TestCase):
190191
def test_buffer_overflow(self):
192+
asan_options = os.environ.get('ASAN_OPTIONS', '')
191193
with support.SuppressCrashReport():
192194
out = assert_python_failure(
193195
'-c', 'import _testcapi; _testcapi.pymem_buffer_overflow()',
194196
PYTHONMALLOC='malloc',
197+
ASAN_OPTIONS=f'{asan_options}:log_path=stderr',
195198
)
196199
self.assertIn(b'AddressSanitizer', out.err)
197200

0 commit comments

Comments
 (0)