Accepting request 515868 from home:oertel:branches:devel:languages:python
- add patch to always trigger overflow in the testsuite (gh#pyca/pyopenssl#657) b3460c6a9a45a016d1ab65c149c606fa3f07096d python-pyOpenSSL-always-overflow.patch OBS-URL: https://build.opensuse.org/request/show/515868 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyOpenSSL?expand=0&rev=41
This commit is contained in:
committed by
Git OBS Bridge
parent
e1cdebaa8f
commit
1f28f7bcc4
30
python-pyOpenSSL-always-overflow.patch
Normal file
30
python-pyOpenSSL-always-overflow.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From b3460c6a9a45a016d1ab65c149c606fa3f07096d Mon Sep 17 00:00:00 2001
|
||||
From: Alex Gaynor <alex.gaynor@gmail.com>
|
||||
Date: Thu, 6 Jul 2017 22:40:40 -0400
|
||||
Subject: [PATCH] Fixed #657 -- handle OverflowErrors on large allocation
|
||||
requests (#659)
|
||||
|
||||
* Fixed #657 -- handle OverflowErrors on large allocation requests
|
||||
|
||||
* always be overflowing
|
||||
|
||||
diff --git a/tests/test_rand.py b/tests/test_rand.py
|
||||
index bdd3af0..41a4f27 100644
|
||||
--- a/tests/test_rand.py
|
||||
+++ b/tests/test_rand.py
|
||||
@@ -32,11 +32,11 @@ class TestRand(object):
|
||||
|
||||
def test_insufficient_memory(self):
|
||||
"""
|
||||
- `OpenSSL.rand.bytes` raises `MemoryError` if more bytes are requested
|
||||
- than will fit in memory.
|
||||
+ `OpenSSL.rand.bytes` raises `MemoryError` or `OverflowError` if more
|
||||
+ bytes are requested than will fit in memory.
|
||||
"""
|
||||
- with pytest.raises(MemoryError):
|
||||
- rand.bytes(sys.maxsize)
|
||||
+ with pytest.raises((MemoryError, OverflowError)):
|
||||
+ rand.bytes(sys.maxsize + 1)
|
||||
|
||||
def test_bytes(self):
|
||||
"""
|
||||
Reference in New Issue
Block a user