--- embedaddon/php/ext/pdo/pdo_sql_parser.re 2012/05/29 12:34:40 1.1.1.2 +++ embedaddon/php/ext/pdo/pdo_sql_parser.re 2013/07/22 01:31:55 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_sql_parser.re,v 1.1.1.2 2012/05/29 12:34:40 misho Exp $ */ +/* $Id: pdo_sql_parser.re,v 1.1.1.3 2013/07/22 01:31:55 misho Exp $ */ #include "php.h" #include "php_pdo_driver.h" @@ -32,12 +32,12 @@ #define YYCTYPE unsigned char #define YYCURSOR cursor -#define YYLIMIT cursor +#define YYLIMIT s->end #define YYMARKER s->ptr -#define YYFILL(n) +#define YYFILL(n) { RET(PDO_PARSER_EOI); } typedef struct Scanner { - char *ptr, *cur, *tok; + char *ptr, *cur, *tok, *end; } Scanner; static int scan(Scanner *s) @@ -51,7 +51,6 @@ static int scan(Scanner *s) COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*); SPECIALS = [:?"']; MULTICHAR = [:?]; - EOF = [\000]; ANYNOEOF = [\001-\377]; */ @@ -64,7 +63,6 @@ static int scan(Scanner *s) SPECIALS { SKIP_ONE(PDO_PARSER_TEXT); } COMMENTS { RET(PDO_PARSER_TEXT); } (ANYNOEOF\SPECIALS)+ { RET(PDO_PARSER_TEXT); } - EOF { RET(PDO_PARSER_EOI); } */ } @@ -94,6 +92,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *i ptr = *outquery; s.cur = inquery; + s.end = inquery + inquery_len + 1; /* phase 1: look for args */ while((t = scan(&s)) != PDO_PARSER_EOI) { @@ -409,9 +408,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inque while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { if(param->parameter) { convert_to_string(param->parameter); - /* accomodate a string that needs to be fully quoted + /* accommodate a string that needs to be fully quoted bind placeholders are at least 2 characters, so - the accomodate their own "'s + the accommodate their own "'s */ newbuffer_len += padding * Z_STRLEN_P(param->parameter); }