commit | 350147b5cacee7a288875007cddf1f7a321a21e2 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 16 22:52:09 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 16 22:52:09 2010 +0000 |
tree | 0a80bfc7d28ecbe2fe90af16dab889a1f1294096 | |
parent | 3f711f4a3e6e2eb9ea9d9d0f841766e9df74ea29 [diff] [blame] |
_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);