Skip to content

Fix bug 1781 - #1796

Closed
kc0bfv wants to merge 1 commit into
nmap:masterfrom
kc0bfv:patch-1
Closed

kc0bfv wants to merge 1 commit into
nmap:masterfrom
kc0bfv:patch-1

Conversation

@kc0bfv

@kc0bfv kc0bfv commented Oct 25, 2019

Copy link
Copy Markdown

This seemed to fix bug #1781 for me. table.unpack on self.headers was returning "nil", and causing the error described in that bug. This addition detects that state in a similar way as the code prior to the most recent commit to this file. The most recent commit to this file seems to have introduced this bug.

This seemed to fix bug nmap#1781 for me.  table.unpack on self.headers was returning "nil", and causing the error described in that bug.  This addition detects that state in a similar way as the code prior to the most recent commit to this file.  The most recent commit to this file seems to have introduced this bug.
@nnposter nnposter self-assigned this Nov 6, 2019

@nnposter nnposter left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of table.unpack() here is flawed in the first place. Consider the following code:

self = {headers = {"ccc", "ddd"}}
req = {"aaa", table.unpack(self.headers), "bbb"}

The desired outcome is that req is now

{"aaa", "ccc", "ddd", "bbb"}

while in reality the result is

{"aaa", "ccc", "bbb"}

The reason is that nested sequences do not get flattened out. Instead only the first element of the child sequence (or nil) is merged into the parent sequence.

@nnposter

nnposter commented Nov 6, 2019

Copy link
Copy Markdown

The issue has been hopefully rectified in r37751. Please report back if the error persists.

@nmap-bot nmap-bot closed this in 08a6d8d Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants