Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with TCP range ports #14

Merged
merged 3 commits into from
May 21, 2015
Merged

Fix issue with TCP range ports #14

merged 3 commits into from
May 21, 2015

Conversation

mvalo
Copy link

@mvalo mvalo commented May 21, 2015

edited by @cusspvz:
closes #13

@cusspvz
Copy link
Member

cusspvz commented May 21, 2015

Nice catch! Thanks!!!

Is there any chance to add test cases for some ports?

  • 6
  • 65
  • 655
  • 6553
  • 65535
  • 65536

@@ -80,7 +80,7 @@ The maximum line lengths the receiver must support including the CRLF are :

var IPv4 = '(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))',
IPv6 = '([0-9a-fA-F]{0,4}:){2,7}(:|[0-9a-fA-F]{1,4})',
Port = '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-2][0-9]{2}|653[0-2][0-9]|6533[0-5])'; // 1..65335
Port = '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-3][0-9]|6553[0-5])'; // 1..65535
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvalo range regexp for ports recreated on an online web tool

Seems that ... 655[0-3][0-9]|6553[0-5] is allowing 65539 which is invalid.

Could you please change this to:

Port = '([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])'; // 1..65535 @ http://utilitymill.com/utility/Regex_For_Range

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch ;-)
Done

cusspvz pushed a commit that referenced this pull request May 21, 2015
related with #14
cusspvz pushed a commit that referenced this pull request May 21, 2015
Fix issue with TCP range ports
@cusspvz cusspvz merged commit 92b42f9 into mosano-eu:master May 21, 2015
cusspvz pushed a commit that referenced this pull request May 21, 2015
cusspvz pushed a commit that referenced this pull request May 21, 2015
related with #14
cusspvz pushed a commit that referenced this pull request May 21, 2015
@cusspvz
Copy link
Member

cusspvz commented May 21, 2015

I did some changes, please check them out!

Thanks once again!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TCP port are from 1 to 65535 and not from 1 to 65335
2 participants