From b3b3fa70e8768b9671cac3082d5e1e2c0d4ecf3a Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 17 Dec 2012 23:34:35 +0000 Subject: [PATCH] Fix broadcast-dropbox-listener not giving output The check for output using maxn was changed to use the # operator in r23147, but the table was not an "array"-style table. Changed it to test for next(ids) instead, which works. --- scripts/broadcast-dropbox-listener.nse | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/broadcast-dropbox-listener.nse b/scripts/broadcast-dropbox-listener.nse index 0f742f15d..9f2b69f74 100644 --- a/scripts/broadcast-dropbox-listener.nse +++ b/scripts/broadcast-dropbox-listener.nse @@ -84,6 +84,10 @@ action = function() -- Check if we've already seen this ID. if ids[info.host_int] then + -- We can stop now, since we've seen the same ID twice + -- If ever a host sends a broadcast twice in a row, this will + -- artificially stop the listener. I can't think of a workaround + -- for now, so this will have to do. break end ids[info.host_int] = true @@ -118,7 +122,7 @@ action = function() sock:close() -- If no broadcasts received, don't output anything. - if #ids == 0 then + if not next(ids) then return end