win32.c: bail out if no memory
* win32/win32.c (rb_w32_write_console): bail out when buffer allocation failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09b02349c2
commit
d63f9e933c
@ -6534,6 +6534,7 @@ rb_w32_write_console(uintptr_t strarg, int fd)
|
|||||||
/* assume UTF-8 */
|
/* assume UTF-8 */
|
||||||
case ENCINDEX_UTF_8:
|
case ENCINDEX_UTF_8:
|
||||||
ptr = wbuffer = mbstr_to_wstr(CP_UTF8, RSTRING_PTR(str), RSTRING_LEN(str), &len);
|
ptr = wbuffer = mbstr_to_wstr(CP_UTF8, RSTRING_PTR(str), RSTRING_LEN(str), &len);
|
||||||
|
if (!ptr) return -1L;
|
||||||
break;
|
break;
|
||||||
case ENCINDEX_UTF_16LE:
|
case ENCINDEX_UTF_16LE:
|
||||||
ptr = (const WCHAR *)RSTRING_PTR(str);
|
ptr = (const WCHAR *)RSTRING_PTR(str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user