vinitshahdeo / PortScanner

A go-to tool for scanning network. Scan all the open ports for a given host with just one click.
https://vinitshahdeo.github.io/PortScanner/
MIT License
133 stars 114 forks source link

[BUG] Duplicate generated ports causing infinite loop #70

Open deprov447 opened 4 years ago

deprov447 commented 4 years ago

Describe the bug

The random ports generated in /server/utils/randomNum.js will have to pass duplicate port numbers to /server/index.js when high - low < countofPorts. This renders index.js file to enter infinite loop.

To Reproduce

Steps to reproduce the behavior:

  1. Go to /
  2. Edit config.json for range.high-range.low < count .
  3. Open terminal and run npm start
  4. See error (infinite loop)

Expected behavior

If the provided range is less than countofPorts, show error and display a message.

deprov447 commented 4 years ago

I would like to work on this @vinitshahdeo

vinitshahdeo commented 4 years ago

@deprov447 Nice catch 👍

Please go ahead. Throw an Invalid Config: (range.high - range.low) should always be greater than count error.

deprov447 commented 4 years ago

@vinitshahdeo By mistake I merged my commit into one of my previous PRs. Please have a look #66