From: Kern Sibbald Date: Thu, 21 Nov 2002 20:40:43 +0000 (+0000) Subject: Length check in UA authorization X-Git-Tag: Release-1.27~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a0dc58f40df4e520529cc6e8f11e99e9fc8d203a;p=bacula%2Fbacula Length check in UA authorization git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@205 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/authenticate.c b/bacula/src/dird/authenticate.c index 81cf4538a4..1b251797b3 100644 --- a/bacula/src/dird/authenticate.c +++ b/bacula/src/dird/authenticate.c @@ -126,11 +126,11 @@ int authenticate_file_daemon(JCR *jcr) */ int authenticate_user_agent(BSOCK *ua) { - char name[128]; + char name[MAXSTRING]; int ok = 0; - - if (sscanf(ua->msg, "Hello %127s calling\n", name) != 1) { + if (ua->msglen > MAXSTRING || + sscanf(ua->msg, "Hello %127s calling\n", name) != 1) { ua->msg[100] = 0; /* terminate string */ Emsg1(M_ERROR, 0, _("Authentication failure: %s"), ua->msg); return 0;