Skip to content
Snippets Groups Projects
Commit d5cd8656 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Fixed infinite looping on unbalanced quotes in queries in utf-8 encode mode.

Rev: lib/modules/Sql.pmod/mysql.pike:1.46
parent 8152508b
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: mysql.pike,v 1.45 2009/11/11 13:38:19 grubba Exp $ * $Id: mysql.pike,v 1.46 2010/01/04 17:18:18 mast Exp $
* *
* Glue for the Mysql-module * Glue for the Mysql-module
*/ */
...@@ -410,6 +410,11 @@ string utf8_encode_query (string q, function(string:string) encode_fn) ...@@ -410,6 +410,11 @@ string utf8_encode_query (string q, function(string:string) encode_fn)
break; break;
} }
if (end < 0)
// The query ends in a quoted string. We pretend it continues to
// the end and let MySQL complain later.
end = sizeof (suffix);
#define IS_IDENTIFIER_CHAR(chr) (Unicode.is_wordchar (chr) || \ #define IS_IDENTIFIER_CHAR(chr) (Unicode.is_wordchar (chr) || \
(<'_', '$'>)[chr]) (<'_', '$'>)[chr])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment