+2005-03-31 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * amd/nfs_subr.c (fh_to_mp3): strncpy may not null terminate if
+ copying exactly len bytes, so add null just to be safe.
+
2005-03-30 Daniel P. Ottavio <dottavio@ic.sunysb.edu>
* amd/nfs_subr.c (fh_to_mp3): Increased the n of strncpy()
2005-03-29 Daniel P. Ottavio <dottavio@ic.sunysb.edu>
* amd/nfs_subr.c (fh_to_mp3): Fix memset bug. In this case
- the memset can be removed because strncpy() should padd the
+ the memset can be removed because strncpy() should padd the
buffer with NULLs anyway.
2005-03-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* SUCH DAMAGE.
*
*
- * $Id: nfs_subr.c,v 1.25 2005/03/30 13:48:33 ottavio Exp $
+ * $Id: nfs_subr.c,v 1.26 2005/03/31 21:59:43 ezk Exp $
*
*/
if (fp->fhh_type != 0) {
/* New filehandle type */
- char *path = xmalloc(sizeof(*fhp) + 1);
- strncpy(path, (char *) fhp, sizeof(*fhp) + 1);
+ int len = sizeof(*fhp);
+ char *path = xmalloc(len + 1);
+ strncpy(path, (char *) fhp, len);
+ path[len+1] = '\0'; /* just to be safe */
/* dlog("fh_to_mp3: new filehandle: %s", path); */
ap = path_to_exported_ap(path);