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.8.0_pre1^2~2543 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ef6ae1e7eda56e1d6ff7b9ade25b290c855e5780;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. Change-Id: I8b8f970213c0beb35a728bcc2158796f84120a3b Reviewed-on: http://gerrit.openafs.org/6861 Reviewed-by: Derrick Brashear Reviewed-by: Alistair Ferguson Tested-by: Derrick Brashear --- diff --git a/src/viced/host.c b/src/viced/host.c index 34c23ff8e..43d3a77fc 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2401,8 +2401,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); }