wallarm / gotestwaf

An open-source project in Golang to asess different API Security tools and WAF for detection logic and bypasses
https://lab.wallarm.com/test-your-waf-before-hackers/
MIT License
1.55k stars 212 forks source link

Error message : "panic: assignment to entry in nil map" #154

Closed eguillotin closed 2 years ago

eguillotin commented 2 years ago

Hi,

I have a "panic: assignment to entry in nil map" error message in the last gotestwaf versions.

This seems to be related to an uninitialized map, however I'm not a go expert and I don't know if my fix has a side effect on the grpc tests that I don't use, so I'll let you check.

I fixed it by initializing counters["api"] in ligne 151 in the report/chart.go file :

if !s.IsGrpcAvailable { // gRPC is part of the API Security tests counters["api"] = make(map[string]pair) counters["api"]["grpc"] = pair{} }

svkirillov commented 2 years ago

Hi!

Did you use your own set of testcases?

eguillotin commented 2 years ago

Hi, no I use the default ones but I run them one by one via the --testSet and --testCase flags and it seemed I didn't get the error for the owasp-api testcases.

svkirillov commented 2 years ago

Fixed in #156