ffuf / ffuf/ffuf

Issue where output file is not created when results present and `-or` flag set

Open
#457 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
16.7k
Forks
1.6k
Avg merge
9m
Merged PRs (30d)
4

Description

The length of `s.Results` is not guaranteed to have the results stored in it at the time of this check. This is because they may still be sitting in `s.CurrentResults` having not been appended. This means when we use the `-or` argument it will always fail to create a file!

We need to check the length of the result from `append(s.Results, s.CurrentResults...)` as you were doing previously inside each `writeJSON`, `writeEJSON`...

nit: it would be simpler to have one line like:
```
res = append(s.Results, s.CurrentResults...)
```
and use the `res` as an arg to pass to all the output functions.

_Originally posted by @hpy in https://github.com/ffuf/ffuf/pull/444#discussion_r645980300_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.