diff options
author | Mark Wells <mark@freeside.biz> | 2014-06-09 16:37:30 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-06-09 16:37:30 -0700 |
commit | 71f60459dbe9f803c0515bd2e54ef18f4e266fa1 (patch) | |
tree | b839857308124a1b7a09333533edb720a7497784 | |
parent | 0fb4ab2c74868ace9e7ac46a5ddb67c7c99597c5 (diff) |
fix checking of address range bounds, #29514, fallout from #26868
-rw-r--r-- | httemplate/edit/process/addr_range.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/httemplate/edit/process/addr_range.html b/httemplate/edit/process/addr_range.html index 5df05596e..c236a7353 100644 --- a/httemplate/edit/process/addr_range.html +++ b/httemplate/edit/process/addr_range.html @@ -13,10 +13,13 @@ $cgi->param('end', $end->addr); $cgi->param('start', $start->addr); } - if ( $start + 0x7FFFFFFF <= $end ) { + # detect addr ranges that are too big + my ($one) = split('\.', $start->addr); + if ( $one < 128 and $start + 0x7FFFFFFF <= $end ) { # then this is going to overflow - return "Address ranges must be < 2^31 - 1 addresses long." - } + return "Address ranges must be < 2^31 - 1 addresses long."; + } # if the first octet is >= 128, then it's in the top half of + # address space and it CAN'T be too big $cgi->param('length', $end - $start + 1); } else { |