[Mod_log_sql] Segfault in 1.99 with CGI Args

Edward Rudd urkle at outoforder.cc
Mon Aug 23 00:50:57 EST 2004


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 <urkle at outoforder.cc>
Website http://www.outoforder.cc/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.outoforder.cc/pipermail/mod_log_sql/attachments/20040823/5c78d58d/attachment.bin 


More information about the Mod_log_sql mailing list