From e5f974bd2d13eb5fcb7b346d781163d0ca9d728b Mon Sep 17 00:00:00 2001 From: Antonio Herraiz Date: Mon, 14 Mar 2016 12:23:27 -0600 Subject: [PATCH] Avoid NULL bytes when writing to file --- lib/core/agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/agent.py b/lib/core/agent.py index b4414d7d7..308cac954 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -746,6 +746,10 @@ class Agent(object): if intoRegExp: intoRegExp = intoRegExp.group(1) query = query[:query.index(intoRegExp)] + # The position is irrelevant when writing into a file, + # so bump the payload to the first position to avoid + # NULL bytes written into the file + position = 0 for element in xrange(0, count): if element > 0: