SOURCES: apache1-mod_pointer-mysql.patch (NEW) - mysql_query fix

glen glen at pld-linux.org
Wed Apr 12 19:21:41 CEST 2006


Author: glen                         Date: Wed Apr 12 17:21:41 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- mysql_query fix

---- Files affected:
SOURCES:
   apache1-mod_pointer-mysql.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/apache1-mod_pointer-mysql.patch
diff -u /dev/null SOURCES/apache1-mod_pointer-mysql.patch:1.1
--- /dev/null	Wed Apr 12 19:21:41 2006
+++ SOURCES/apache1-mod_pointer-mysql.patch	Wed Apr 12 19:21:36 2006
@@ -0,0 +1,22 @@
+mod_real_query() is for binary data. and using MAX_QUERY_LENGTH will also pass
+uninitialized buffer to mysql server which will result syntax error
+
+so should pass there strlen(query) instead, but lets rather use mysql_query()
+which will use \0 terminated string.
+
+also the patch includes query into apache error log if the query failed.
+
+--- mod_pointer-0.8/mod_my_pointer.c	2002-06-18 18:33:13.000000000 +0300
++++ mod_pointer-0.8-mysql/mod_my_pointer.c	2006-04-12 20:14:39.662876705 +0300
+@@ -395,9 +395,9 @@
+                 cfg->mysqlurlfield, cfg->mysqlframefield, cfg->mysqltitlefield,
+                 cfg->mysqlpassargsfield, cfg->mysqlptrtable, cfg->mysqlhostfield, pointer_host);
+ 
+-    if (mysql_real_query(mysql_handle, query, MAX_QUERY_LENGTH) != 0) {
++    if (mysql_query(mysql_handle, query) != 0) {
+         ap_log_error (APLOG_MARK, APLOG_ERR, r->server,
+-                      "[mod_pointer]: MySQL error %s: %s", mysql_error(mysql_handle), r->uri);
++                      "[mod_pointer]: MySQL error %s: %s: [%s]", mysql_error(mysql_handle), r->uri, query);
+         return SERVER_ERROR;
+     }
+ 
================================================================


More information about the pld-cvs-commit mailing list