ronin-rb / ronin-masscan

A Ruby library and CLI for working with masscan.
https://ronin-rb.dev
GNU Lesser General Public License v3.0
3 stars 1 forks source link

`undefined method '<<' for nil:NilClass` in `Converters::CSV.masscan_file_to_csv` #14

Closed AI-Mozi closed 9 months ago

AI-Mozi commented 9 months ago

In Converters::CSV.convert output argument will be set to nil if we wont specify it. Then it will call masscan_file_to_csv(mascan_file, nil) so masscan_file_to_csv's output argument default value won't be applied and << will be called on Nil.

I think we should change default value in .convert from nil to String.new

postmodern commented 9 months ago

You are correct. It should either be changed to masscan_file_to_csv(masscan_file,*output) to cause the nil value to be omitted, or change output=nil to output=String.new to match masscan_file_to_csv.

postmodern commented 9 months ago

Looking at ronin-nmap/lib/ronin/nmap/converters/csv.rb, it uses output=String.new, so I vote for that option to remain consistent.

postmodern commented 9 months ago

Fixed by #15.