mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 15:53:10 +08:00
fix multiple mem leaks + optimizations (#4630)
* fix mem leak * bump version tag * http: add global resp body read limit of 4MB * skip creating templateCtx in normal templates * fix mem leak via retryablehttp , fastdialer * go mod tidy * remove unused var * dep update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
This commit is contained in:
@@ -144,8 +144,10 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicVa
|
||||
|
||||
// inject all template context values as gozero env allvars
|
||||
allvars := protocolutils.GenerateVariables(input.MetaInput.Input, false, nil)
|
||||
// add template context values
|
||||
allvars = generators.MergeMaps(allvars, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
||||
// add template context values if available
|
||||
if request.options.HasTemplateCtx(input.MetaInput) {
|
||||
allvars = generators.MergeMaps(allvars, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
||||
}
|
||||
// optionvars are vars passed from CLI or env variables
|
||||
optionVars := generators.BuildPayloadFromOptions(request.options.Options)
|
||||
variablesMap := request.options.Variables.Evaluate(allvars)
|
||||
@@ -206,7 +208,9 @@ func (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicVa
|
||||
request.options.AddTemplateVars(input.MetaInput, request.Type(), request.ID, data)
|
||||
|
||||
// add variables from template context before matching/extraction
|
||||
data = generators.MergeMaps(data, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
||||
if request.options.HasTemplateCtx(input.MetaInput) {
|
||||
data = generators.MergeMaps(data, request.options.GetTemplateCtx(input.MetaInput).GetAll())
|
||||
}
|
||||
|
||||
if request.options.Interactsh != nil {
|
||||
request.options.Interactsh.MakePlaceholders(interactshURLs, data)
|
||||
|
||||
Reference in New Issue
Block a user