Commit 7c84ef0790275b20085c4f2f5d6543da4fa9cb27

Stefan Sperling 2021-08-29T19:50:57

reject port number zero

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libexec/got-read-gotconfig/parse.y b/libexec/got-read-gotconfig/parse.y
index b22c70a..dba9481 100644
--- a/libexec/got-read-gotconfig/parse.y
+++ b/libexec/got-read-gotconfig/parse.y
@@ -535,7 +535,7 @@ getservice(char *n)
 	u_long		 ulval;
 
 	if (atoul(n, &ulval) == 0) {
-		if (ulval > 65535) {
+		if (ulval == 0 || ulval > 65535) {
 			yyerror("illegal port value %lu", ulval);
 			return (-1);
 		}