From 3f36981440d37f6c6b708e9af3012ee7fd6c9de0 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 15 Feb 2010 20:21:29 +0000 Subject: [PATCH] Qualify an assertion to allow zero-byte writes in Nsock. The assertion checked that the internal buffer was not empty before a send; I changed it to have an effect only when at least one byte has been written already. Formerly, zero-byte sends such as socket:send("") in NSE would crash Nmap, for both UDP and TCP. I tested this change on Linux, and for UDP it sends a zero-byte datagram, and for TCP it sends nothing at all. --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d114b3211..72c5e86d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,12 @@ [NOT YET RELEASED] +o Qualified an assertion to allow zero-byte sends in Nsock. Without + this, an NSE script could cause this assertion failure by doing + socket:send(""): + nmap: nsock_core.c:516: handle_write_result: Assertion `bytesleft > 0' failed. + [David] + o Added a service probe for Logitech SqueezeCenter command line interface [Patrik]