mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
closes bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599)
Checks also for encryption algorithms methods not supported in different OSs. Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
This commit is contained in:
parent
4d5f94b8cd
commit
0d3fe8ae49
3 changed files with 13 additions and 1 deletions
|
@ -42,6 +42,9 @@ crypt_crypt_impl(PyObject *module, const char *word, const char *salt)
|
|||
#else
|
||||
crypt_result = crypt(word, salt);
|
||||
#endif
|
||||
if (crypt_result == NULL) {
|
||||
return PyErr_SetFromErrno(PyExc_OSError);
|
||||
}
|
||||
return Py_BuildValue("s", crypt_result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue