There were several serious software flaws in the 1.0 release of this software. This patch fixes the following issues:
-A buffer overflow existed in the query parser which could allow remote code execution. Simply querying the server with a long enough string (4096 characters does the trick) would cause a crash. This patch dynamically re-sizes the affected buffer.
-There were several massive memory leaks. Every single client connection would leak an entire POSIX thread since they weren't being properly detached. This patch correctly detaches these threads. It also fixes several other memory leaks.
-A race condition existed in the parser code. This patch locks the parser with a semaphore.
-A new mysql connection was created for each client connection and was not properly closed afterwords. Thus each client connection caused a MySQL socket leak. This patch creates a single MySQL connection (also locked with a semaphore) that all threads share.
Use 'patch -p3 < rwhoisd-final-fixed-memory-leaks.patch' to apply this patch.
Use 'patch -p3 < rwhoisd-final-fixed-memory-leaks.patch' to apply this patch.