about summary refs log tree commit diff
path: root/nis/nss_nisplus
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nisplus')
-rw-r--r--nis/nss_nisplus/nisplus-publickey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nis/nss_nisplus/nisplus-publickey.c b/nis/nss_nisplus/nisplus-publickey.c
index 72ed1a5044..aa2a6f0c3a 100644
--- a/nis/nss_nisplus/nisplus-publickey.c
+++ b/nis/nss_nisplus/nisplus-publickey.c
@@ -162,8 +162,8 @@ _nss_nisplus_getsecretkey (const char *netname, char *skey, char *passwd)
 
   len = ENTRY_LEN (res->objects.objects_val, 4);
   memcpy (buf, ENTRY_VAL (res->objects.objects_val,4), len);
-  skey[len] = 0;
-  cptr = strchr (skey, ':');
+  buf[len] = '\0';
+  cptr = strchr (buf, ':');
   if (cptr)
     cptr[0] = '\0';
   nis_freeresult (res);