Re: Segfault in 1.99 with CGI Args

Edward Rudd <[email protected]> Mon, 23 Aug 2004 00:50:57 -0500
Newsgroups gmane.comp.apache.mod-log-sql
Organization OutOfOrder.cc
Message-ID <[email protected]>
On Wed, 2004-08-18 at 12:56, Douglas E. Warner wrote:

[snip]
> I think I tracked down the problem; actually, it seemed like a two-part 
> problem:
> 
> 1) the mysql escape function wasn't matching empty strings by the first 'if' 
> statement, only null strings.
> 
> 2) when a null string was matched my the mysql escape function, it returned a 
> literal NULL instead of the string 'NULL' which was needed in the insert 
> statement.
This was only part of the problem.. this was just causing mysql_query to
return a bad syntax error when running the query, which my code would
"disconnect and reconnect" to the DB (I assumed my SQL was valid..
oops).  and then when it reconnected it would crash inside of the mysql
client libs, as i passed it a block of memory that the mysql_close
function had freed.  Guess I didn't read the "it will be freed
mysql_close is called to close the connection" in the MySQL manual.

There is a new patch on the website that fixes both issues. 
> I've attached my patch; feel free to modify it for your uses, it seems to work 
> for me.
Many thanks to you for your patch. 
> - -Doug

-- 
Edward Rudd <[email protected]>
Website http://www.outoforder.cc/

_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe-7qY7E20V6GW73k+5HYS8LQqVMODqnSLI@public.gmane.org
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQBBKYXBvwMxRUUct20RArMFAJ9WPEr+/EwnDSTTWnPsUiRguLXVowCdE4ZQ
qEAkCmtQoB4Ie7rn1yvBQTA=
=G6BL
-----END PGP SIGNATURE-----