summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-10-20 17:22:27 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 09:54:28 -0600
commit73fe690db2241bf99590f9217da2d4e51c742fb2 (patch)
tree29d2d5147fa4a83ddcc18a6857645baff82153ef /src
parente5fb5fe5ad50fc60831fa33531ffef2dae3e1967 (diff)
downloadlibgit2-73fe690db2241bf99590f9217da2d4e51c742fb2.tar.gz
gssapi: protect against empty messages
Diffstat (limited to 'src')
-rw-r--r--src/transports/auth_negotiate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index 260fc1ceb..1c79a2468 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);