Closed
Conversation
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
reviewed
Nov 6, 2019
nnposter
left a comment
There was a problem hiding this comment.
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.
|
The issue has been hopefully rectified in r37751. Please report back if the error persists. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.