From 1f16a8cca28cb9e71586fd3ff0dc28fb7a8ee59e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 30 Jul 2008 01:00:30 +1200 Subject: [PATCH] Author: Markus Bug 2426: Increase buffer in authenticateNegotiateStart --- src/auth/negotiate/auth_negotiate.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index 36ff22f34b..cfde0a883a 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -55,6 +55,11 @@ \ingroup AuthNegotiateAPI */ +/** + * Maximum length (buffer size) for token strings. + */ +#define MAX_AUTHTOKEN_LEN 32768 + static void authenticateNegotiateReleaseServer(AuthUserRequest * auth_user_request); @@ -562,7 +567,7 @@ void AuthNegotiateUserRequest::module_start(RH * handler, void *data) { authenticateStateData *r = NULL; - static char buf[8192]; + static char buf[MAX_AUTHTOKEN_LEN]; negotiate_user_t *negotiate_user; AuthUser *auth_user = user(); @@ -588,9 +593,9 @@ AuthNegotiateUserRequest::module_start(RH * handler, void *data) AUTHUSERREQUESTLOCK(r->auth_user_request, "r"); if (auth_state == AUTHENTICATE_STATE_INITIAL) { - snprintf(buf, 8192, "YR %s\n", client_blob); //CHECKME: can ever client_blob be 0 here? + snprintf(buf, MAX_AUTHTOKEN_LEN, "YR %s\n", client_blob); //CHECKME: can ever client_blob be 0 here? } else { - snprintf(buf, 8192, "KK %s\n", client_blob); + snprintf(buf, MAX_AUTHTOKEN_LEN, "KK %s\n", client_blob); } waiting = 1; -- 2.47.2