off-by-one-20040510
authorJeffrey Altman <jaltman@mit.edu>
Tue, 11 May 2004 03:08:50 +0000 (03:08 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 11 May 2004 03:08:50 +0000 (03:08 +0000)
off by one error when allocating memory for mountPointStringp
in cm_GetSCacheEntry when using Freelance mode

src/WINNT/afsd/cm_scache.c

index 5b5694c..ced5db1 100644 (file)
@@ -307,7 +307,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp,
 
                lock_ObtainMutex(&cm_Freelance_Lock);
                scp->length.LowPart = strlen(mp)+4;
-               scp->mountPointStringp=malloc(strlen(mp));
+               scp->mountPointStringp=malloc(strlen(mp)+1);
                strcpy(scp->mountPointStringp,mp);
                lock_ReleaseMutex(&cm_Freelance_Lock);