Hi,

I experienced exactly the same thing today on my server, and the problem is rather simple:

When compiling for apache2, the function apr_pstrcat is used when allocating the query string, but since apr_strings.h is not included in mod_auth_mysql.c, the function has not been declared and the compiler will assume that the return type is an int and warn you with the messages:

mod_auth_mysql.c: In function 'mysql_check_user_password':
mod_auth_mysql.c:1577: warning: cast to pointer from integer of different size
mod_auth_mysql.c: In function 'mysql_check_group':
mod_auth_mysql.c:1681: warning: cast to pointer from integer of different size

In the end, apr_pstrcat returns a proper pointer, but since int is 32-bit and pointers are 64-bit on amd64, the most significant 32 bits of the pointer are modified upon return, causing a segmentation fault later on when the pointer is accessed.

So a simple patch would look like:

--- mod_auth_mysql.c.bak        2009-08-31 23:47:55.000000000 +0200
+++ mod_auth_mysql.c    2009-08-31 23:47:41.000000000 +0200
@@ -51,6 +51,7 @@
 #include <apr_general.h>
 #include <apr_md5.h>
 #include <apr_sha1.h>
+#include <apr_strings.h>
 #else
 #include <ap_md5.h>
 #include <ap_sha1.h>

Best regards,
Peter Christensen



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to