From: Michael Meffie Date: Sat, 3 Mar 2012 15:05:01 +0000 (-0500) Subject: viced: fix log message for MapName_r X-Git-Tag: upstream/1.6.3^2~30 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ef562f58195a75cb8c9e7437ced6f1f40387f8ec;p=packages%2Fo%2Fopenafs.git viced: fix log message for MapName_r Do not log a code of zero if the name plus instance length exceeds the max pr name buffer. Reviewed-on: http://gerrit.openafs.org/6861 Reviewed-by: Derrick Brashear Reviewed-by: Alistair Ferguson Tested-by: Derrick Brashear (cherry picked from commit ef6ae1e7eda56e1d6ff7b9ade25b290c855e5780) Change-Id: If644670ed522eaba575e7246084f106231649991 Reviewed-on: http://gerrit.openafs.org/9474 Reviewed-by: Derrick Brashear Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand Tested-by: BuildBot --- diff --git a/src/viced/host.c b/src/viced/host.c index 58106338a..9921912e6 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2462,8 +2462,10 @@ h_FindClient_r(struct rx_connection *tcon) tname, tinst, tcell, expTime, kvno)); strncpy(uname, tname, sizeof(uname)); if (ilen) { - if (strlen(uname) + 1 + ilen >= sizeof(uname)) + if (strlen(uname) + 1 + ilen >= sizeof(uname)) { + code = -1; goto bad_name; + } strcat(uname, "."); strcat(uname, tinst); }