From ef6ae1e7eda56e1d6ff7b9ade25b290c855e5780 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Sat, 3 Mar 2012 10:05:01 -0500 Subject: [PATCH] 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 --- src/viced/host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.39.5