mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-28 01:41:14 -06:00
Fixed IPv6 validation special case: single colon
IPv6 parsing was incorrectly evaluating ':' as a valid IPv6 address. https://fedorahosted.org/freeipa/ticket/1466
This commit is contained in:
parent
c7ae0c20db
commit
ceee08faa1
@ -125,6 +125,11 @@ NET.ip_address = function(spec) {
|
||||
|
||||
var i;
|
||||
|
||||
//usecases like ':'
|
||||
if (that.parts.length <= 2) {
|
||||
return that.set_error('invalid format');
|
||||
}
|
||||
|
||||
for (i=0; i<that.parts.length; i++) {
|
||||
var part = that.parts[i];
|
||||
|
||||
|
@ -156,6 +156,9 @@ test('Testing incorrect IPv6 addresses', function() {
|
||||
address = NET.ip_address('2001:db8:85a3:0:0:8a2e:370');
|
||||
ok(!address.valid, 'Missing part - 2001:db8:85a3:0:0:8a2e:370');
|
||||
|
||||
address = NET.ip_address(':');
|
||||
ok(!address.valid, 'Address - :');
|
||||
|
||||
address = NET.ip_address('::1::');
|
||||
ok(!address.valid, 'Address - ::1::');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user