[前][次][番号順一覧][スレッド一覧]

ruby-changes:31157

From: nobu <ko1@a...>
Date: Thu, 10 Oct 2013 15:33:45 +0900 (JST)
Subject: [ruby-changes:31157] nobu:r43236 (trunk): win32.c: bail out if no memory

nobu	2013-10-10 15:33:38 +0900 (Thu, 10 Oct 2013)

  New Revision: 43236

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43236

  Log:
    win32.c: bail out if no memory
    
    * win32/win32.c (rb_w32_write_console): bail out when buffer
      allocation failed.

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 43235)
+++ win32/win32.c	(revision 43236)
@@ -6534,6 +6534,7 @@ rb_w32_write_console(uintptr_t strarg, i https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L6534
 	/* assume UTF-8 */
       case ENCINDEX_UTF_8:
 	ptr = wbuffer = mbstr_to_wstr(CP_UTF8, RSTRING_PTR(str), RSTRING_LEN(str), &len);
+	if (!ptr) return -1L;
 	break;
       case ENCINDEX_UTF_16LE:
 	ptr = (const WCHAR *)RSTRING_PTR(str);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]