diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-04-11 13:37:14 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-04-11 13:37:14 +0200 |
commit | cab543787b4adb628df86cfa5cc67382920eec03 (patch) | |
tree | 7e993288b9a2e3e65f3138884d6c24b2626ce712 | |
parent | cb6bba489b01977952efd30eb2fc0aff2db3b081 (diff) | |
download | psutil-cab543787b4adb628df86cfa5cc67382920eec03.tar.gz |
check PyUnicodeDecode return value
-rw-r--r-- | psutil/_psutil_windows.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index abbbe06d..8e3f9593 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -2565,6 +2565,8 @@ psutil_users(PyObject *self, PyObject *args) { py_buffer_user_encoded = PyUnicode_Decode( buffer_user, _tcslen(buffer_user), Py_FileSystemDefaultEncoding, "replace"); + if (py_buffer_user_encoded == NULL) + goto error; py_tuple = Py_BuildValue("OOd", py_buffer_user_encoded, py_address, (double)unix_time); if (!py_tuple) |