diff options
Diffstat (limited to 'src/lib/krb4/dest_tkt.c')
-rw-r--r-- | src/lib/krb4/dest_tkt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/krb4/dest_tkt.c b/src/lib/krb4/dest_tkt.c index 7057818..50c1352 100644 --- a/src/lib/krb4/dest_tkt.c +++ b/src/lib/krb4/dest_tkt.c @@ -87,8 +87,9 @@ out: /* * handle the shared memory case */ - (void) strcpy(shmidname, file); - (void) strcat(shmidname, ".shm"); + (void) strncpy(shmidname, file, sizeof(shmidname) - 1); + shmidname[sizeof(shmidname) - 1] = '\0'; + (void) strcat(shmidname, ".shm", sizeof(shmidname) - 1 - strlen(shmidname)); if ((i = krb_shm_dest(shmidname)) != KSUCCESS) return(i); #endif /* TKT_SHMEM */ |