]> granicus.if.org Git - php/commitdiff
Fix bug #70861 Segmentation fault in pdo_parse_params() during Drupal 8 test suite
authorAnatol Belski <ab@php.net>
Thu, 5 Nov 2015 13:35:41 +0000 (14:35 +0100)
committerAnatol Belski <ab@php.net>
Thu, 5 Nov 2015 13:46:28 +0000 (14:46 +0100)
ext/pdo/pdo_sql_parser.c

index 155ca95c1c7bc2f287556d185b17d6c40821f366..0907571e0832df3673db5abbfa5f611e599866bf 100644 (file)
@@ -575,6 +575,10 @@ safe:
                                                zend_string *buf;
 
                                                buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
+                                               if (!buf) {
+                                                       ret = -1;
+                                                       goto clean_up;
+                                               }
                                                if (!stmt->dbh->methods->quoter(stmt->dbh, ZSTR_VAL(buf), ZSTR_LEN(buf), &plc->quoted, &plc->qlen,
                                                                param->param_type)) {
                                                        /* bork */