Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the failed regexp pattern in the log output. #397

Merged
merged 2 commits into from Oct 8, 2019
Merged

Include the failed regexp pattern in the log output. #397

merged 2 commits into from Oct 8, 2019

Conversation

cfi-gb
Copy link
Member

@cfi-gb cfi-gb commented Oct 8, 2019

This helps to debug VTs like e.g.:

/opt/greenbone/feed/plugins/2018/gb_sensitive_file_disclosures_http.nasl)(http_keepalive.inc:912) In function 'http_vuln_check()': egrep() : regcomp() failed

not directly calling the regexp NASL functions and using multiple regular expressions.

Testing NASL script:

pattern = "{1,2";
string = "test";

egrep(string:string, pattern:pattern);
ereg(string:string, pattern:pattern);
eregmatch(string:string, pattern:pattern);

Before:

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:4) egrep() : regcomp() failed

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:5) ereg() : regcomp() failed

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:6) regmatch() : regcomp() failed

Afterwards:

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:4) egrep() : regcomp() failed for pattern '{1,2'.

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:5) ereg() : regcomp() failed for pattern '{1,2'.

lib  nasl-Message: 07:32:25.508: [12232](regxp.nasl:6) regmatch() : regcomp() failed for pattern '{1,2'.

@jjnicola jjnicola merged commit 707374d into greenbone:master Oct 8, 2019
@cfi-gb cfi-gb deleted the regexp_logging branch October 8, 2019 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants