[Groonga-commit] groonga/groonga at 0f9398e [master] bindings/php: add a missing check for a memory allocation failure

Back to archive index

susumu.yata null+****@clear*****
Wed Jul 1 19:39:50 JST 2015


susumu.yata	2015-07-01 19:39:50 +0900 (Wed, 01 Jul 2015)

  New Revision: 0f9398e1cbba9c0c48444e722e226db4c00ac2cf
  https://github.com/groonga/groonga/commit/0f9398e1cbba9c0c48444e722e226db4c00ac2cf

  Message:
    bindings/php: add a missing check for a memory allocation failure
    
    Reported by by Bill Parker. Thanks!!!

  Modified files:
    bindings/php/groonga.c

  Modified: bindings/php/groonga.c (+3 -0)
===================================================================
--- bindings/php/groonga.c    2015-07-01 18:29:07 +0900 (b92cc1a)
+++ bindings/php/groonga.c    2015-07-01 19:39:50 +0900 (a04bb9c)
@@ -101,6 +101,9 @@ PHP_FUNCTION(grn_ctx_init)
   long flags = 0;
   grn_rc rc;
 
+  if (ctx == NULL) {
+    RETURN_FALSE; // unable to allocate memory for ctx
+  }
 
   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
     return;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index