Commit 73fe690db2241bf99590f9217da2d4e51c742fb2

Edward Thomson 2019-10-20T17:22:27

gssapi: protect against empty messages

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index 260fc1c..1c79a24 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -160,6 +160,12 @@ static int negotiate_next_token(
 		goto done;
 	}
 
+	if (output_token.length == 0) {
+		git_error_set(GIT_ERROR_NET, "GSSAPI did not return token");
+		error = -1;
+		goto done;
+	}
+
 	git_buf_puts(buf, "Negotiate ");
 	git_buf_encode_base64(buf, output_token.value, output_token.length);