$OpenBSD: patch-hardlink_c,v 1.2 2007/04/01 07:08:39 steven Exp $
--- hardlink.c.orig	Wed May 21 00:23:11 2003
+++ hardlink.c	Sun Apr  1 08:18:32 2007
@@ -79,6 +79,7 @@ d_insert( struct devlist **dev_head, struct pathinfo *
 i_insert( struct devlist *dev_head, struct pathinfo *pinfo )
 {
     struct inolist	*new, **cur;
+    size_t buflen;
 
     for ( cur = &dev_head->d_ilist; *cur != NULL; cur = &(*cur)->i_next ) {
 	if ( pinfo->pi_stat.st_ino <= (*cur)->i_ino ) {
@@ -96,13 +97,14 @@ i_insert( struct devlist *dev_head, struct pathinfo *p
 	exit( 2 );
     }
 
-    if (( new->i_name = ( char * ) malloc( strlen( pinfo->pi_name ) + 1 ))
+    buflen = strlen( pinfo->pi_name ) + 1;
+    if (( new->i_name = ( char * ) malloc( buflen ))
 	    == NULL ) {
 	perror( "i_insert malloc" );
 	exit( 2 );
     }
 
-    strcpy( new->i_name, pinfo->pi_name );
+    (void)strlcpy( new->i_name, pinfo->pi_name, buflen );
     new->i_ino = pinfo->pi_stat.st_ino;
     new->i_flag = 0;
 
