Skip to content

Commit 89667f9

Browse files
committed
Add null checks to version/pending
1 parent e436664 commit 89667f9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

wolfssl/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def _release_native_object(self):
495495
self.native_object = _ffi.NULL
496496

497497
def pending(self):
498+
self._check_closed("pending")
498499
return _lib.wolfSSL_pending(self.native_object)
499500

500501
@property
@@ -894,7 +895,10 @@ def version(self):
894895
"""
895896
Returns the version of the protocol used in the connection.
896897
"""
897-
return _ffi.string(_lib.wolfSSL_get_version(self.native_object)).decode("ascii")
898+
self._check_closed("version")
899+
return _ffi.string(
900+
_lib.wolfSSL_get_version(
901+
self.native_object)).decode("ascii")
898902

899903
# The following functions expose functionality of the underlying
900904
# Socket object. These are also exposed through Python's ssl module

0 commit comments

Comments
 (0)