Skip to content

Commit cab5437

Browse files
committed
check PyUnicodeDecode return value
1 parent cb6bba4 commit cab5437

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

psutil/_psutil_windows.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,6 +2565,8 @@ psutil_users(PyObject *self, PyObject *args) {
25652565
py_buffer_user_encoded = PyUnicode_Decode(
25662566
buffer_user, _tcslen(buffer_user), Py_FileSystemDefaultEncoding,
25672567
"replace");
2568+
if (py_buffer_user_encoded == NULL)
2569+
goto error;
25682570
py_tuple = Py_BuildValue("OOd", py_buffer_user_encoded, py_address,
25692571
(double)unix_time);
25702572
if (!py_tuple)

0 commit comments

Comments
 (0)