Skip to content

Commit

Permalink
fixed a serious issue in iplist caused by uninitialized array. This c…
Browse files Browse the repository at this point in the history
…aused the command to look like it was unrecognized, however it was due to gen_list_from_pcap failing
  • Loading branch information
dakrone committed Oct 27, 2008
1 parent 74be2a5 commit 91f05f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions TODO
Expand Up @@ -55,6 +55,7 @@ DONE - "iplist" command needs to support directories of pcap files
- Rewrite pcapparser to use Ruby's builtin BinData so it's easier to extend
DONE - Expand ~ for modload command
- Make nsm-console "installable" to a different directory, rather than running it out of the distribution dir.
DONE - Fixed error in iplist where the ips were not listed due to uninitialized array.


IDEAS:
Expand Down
4 changes: 2 additions & 2 deletions lib/commands.rb
Expand Up @@ -830,8 +830,8 @@


## The iplist command
command "Generate a list of all the IPs in a file. Usage: iplist [file] (if no file is specified, stdout is used)","iplist" do |file|
file = file.to_s.chomp
command "Generate a list of all the IPs in a file. Usage: iplist [file] (if no file is specified, stdout is used)","iplist" do |args|
file = args.to_s.chomp

iplist = {}

Expand Down
3 changes: 3 additions & 0 deletions lib/nsm_helper.rb
Expand Up @@ -324,6 +324,9 @@ def get_uncompressed_filename(file)
def gen_list_from_pcap
list = {}

# initialize empty array of file names
fnames = []

# get a list of files, otherwise just do one
if (File.directory?($datafile))
fnames = get_filelist($datafile,true)
Expand Down

0 comments on commit 91f05f7

Please sign in to comment.