_Py_wreadlink(): catch _Py_char2wchar() failure
diff --git a/Python/fileutils.c b/Python/fileutils.c
index cfafd86..147636f 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -326,6 +326,10 @@
     }
     cbuf[res] = '\0'; /* buf will be null terminated */
     wbuf = _Py_char2wchar(cbuf);
+    if (wbuf == NULL) {
+        errno = EINVAL;
+        return -1;
+    }
     r1 = wcslen(wbuf);
     if (bufsiz <= r1) {
         PyMem_Free(wbuf);