diff --git a/nselib/bittorrent.lua b/nselib/bittorrent.lua index c8f1916b7..5806b8e4b 100644 --- a/nselib/bittorrent.lua +++ b/nselib/bittorrent.lua @@ -206,7 +206,7 @@ bdecode = function(buf) pos = pos+1 -- trailing whitespace - elseif string.match(buf, "%s*$", pos) then + elseif string.match(buf, "^%s*$", pos) then pos = len+1 else return nil, "Unknown type found.", pos