/*
- * $Id: appl.c,v 1.12.2.1 2003-05-10 10:33:16 didg Exp $
+ * $Id: appl.c,v 1.12.2.1.2.1 2004-02-13 22:32:17 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
* but uses upaths instead of mac format paths.
*
* The new way: dir and path refer to an app, path is a mac format
- * pathname. makemacpath() builds a cname.
+ * pathname. makemacpath() builds a cname. (zero is a path separator
+ * and it's not \0 terminated).
*
* See afp_getappl() for the backward compatiblity code.
*/
p = mpath + mpathlen;
p -= strlen( path );
- strncpy( p, path, strlen( path ));
+ memcpy( p, path, strlen( path ));
while ( dir->d_parent != NULL ) {
p -= strlen( dir->d_m_name ) + 1;
+ if (p < mpath) {
+ /* FIXME: pathname too long */
+ return NULL;
+ }
strcpy( p, dir->d_m_name );
dir = dir->d_parent;
}
}
mpath = obj->newtmp;
mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
+ if (!mp) {
+ return AFPERR_PARAM;
+ }
mplen = mpath + AFPOBJ_TMPSIZ - mp;
/* write the new appl entry at start of temporary file */
}
mpath = obj->newtmp;
mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
+ if (!mp) {
+ return AFPERR_PARAM ;
+ }
+
mplen = mpath + AFPOBJ_TMPSIZ - mp;
cc = copyapplfile( sa.sdt_fd, tfd, mp, mplen );
close( tfd );
/*
- * $Id: directory.c,v 1.71.2.4.2.8 2004-02-09 23:49:31 bfernhomberg Exp $
+ * $Id: directory.c,v 1.71.2.4.2.9 2004-02-13 22:32:18 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
*--p = '/';
p -= n;
- strncpy( p, u, n );
+ memcpy( p, u, n );
}
if ( d != curdir ) {
n = strlen( vol->v_path );
}
*--p = '/';
p -= n;
- strncpy( p, vol->v_path, n );
+ memcpy( p, vol->v_path, n );
}
if ( chdir( p ) < 0 ) {
switch (errno) {
/*
- * $Id: filedir.c,v 1.45.2.2.2.5 2004-01-08 03:50:56 bfernhomberg Exp $
+ * $Id: filedir.c,v 1.45.2.2.2.6 2004-02-13 22:32:18 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*p = '\0';
len = strlen( u );
p -= len;
- strncpy( p, u, len );
+ memcpy( p, u, len );
if (dir) for ( d = dir; d->d_parent; d = d->d_parent ) {
u = d->d_u_name;
len = strlen( u );
}
*--p = '/';
p -= len;
- strncpy( p, u, len );
+ memcpy( p, u, len );
}
len = strlen( vol->v_path );
if (p -len -1 < path) {
}
*--p = '/';
p -= len;
- strncpy( p, vol->v_path, len );
+ memcpy( p, vol->v_path, len );
return( p );
}