viced: fix log message for MapName_r
authorMichael Meffie <mmeffie@sinenomine.net>
Sat, 3 Mar 2012 15:05:01 +0000 (10:05 -0500)
committerDerrick Brashear <shadow@dementix.org>
Wed, 11 Apr 2012 16:02:37 +0000 (09:02 -0700)
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 <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementix.org>

src/viced/host.c

index 34c23ff..43d3a77 100644 (file)
@@ -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);
            }