From dda4020fd07fab5fca26659229eab436472276b2 Mon Sep 17 00:00:00 2001 From: tytso Date: Fri, 10 Dec 1993 14:00:49 +0000 Subject: [PATCH] Use strncpy instead of bcopy when copying the entity argument, to prevent an illegal memory access past the end of malloc'ed area. Added support for optional debugging malloc. No code changes if you are using the normal malloc in mr_smalloc.c --- server/mr_sauth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/mr_sauth.c b/server/mr_sauth.c index c27ec945..dcb45b23 100644 --- a/server/mr_sauth.c +++ b/server/mr_sauth.c @@ -21,7 +21,6 @@ static char *rcsid_sms_sauth_c = "$Header$"; extern char buf1[]; extern char *whoami; -extern char *malloc(); char *kname_unparse(); @@ -81,7 +80,7 @@ do_auth(cl) &cl->client_id, &cl->users_id); if (cl->args->mr_version_no == MR_VERSION_2) { - bcopy(cl->args->mr_argv[1], cl->entity, 8); + strncpy(cl->entity, cl->args->mr_argv[1], 8); cl->entity[8] = 0; } else { strcpy(cl->entity, "???"); -- 2.45.2