]> git.pld-linux.org Git - packages/apache1-mod_pointer.git/commitdiff
- mysql_query fix
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 12 Apr 2006 17:21:36 +0000 (17:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache1-mod_pointer-mysql.patch -> 1.1

apache1-mod_pointer-mysql.patch [new file with mode: 0644]

diff --git a/apache1-mod_pointer-mysql.patch b/apache1-mod_pointer-mysql.patch
new file mode 100644 (file)
index 0000000..4cb2423
--- /dev/null
@@ -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;
+     }
This page took 0.067067 seconds and 4 git commands to generate.