Skip to content

Commit b5cc54a

Browse files
committed
Fix ipv6 colon parsing
1 parent 29129b8 commit b5cc54a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

conformance/expected-failures.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ kitchen_sink:
2727
standard_rules/repeated:
2828
- items/in/invalid
2929
- items/not_in/invalid
30-
library/is_ip:
31-
- version/6/invalid/ipv6/7h16_double_colon_1h16
32-
- version/6/invalid/ipv6/7h16_double_colon
33-
- version/6/invalid/ipv6/double_colon_8h16
34-
- version/6/invalid/ipv6/1h16_double_colon_7h16
3530
standard_rules/well_known_types/duration:
3631
- in/invalid
3732
- not in/invalid
38-
39-

src/main/java/build/buf/protovalidate/Ipv6.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ private boolean addressPart() {
209209
break;
210210
}
211211

212-
return this.doubleColonSeen || this.pieces.size() == 8;
212+
int totalPieces = this.pieces.size();
213+
if (this.doubleColonSeen) {
214+
return totalPieces < 8;
215+
}
216+
return totalPieces == 8;
213217
}
214218

215219
/**

0 commit comments

Comments
 (0)