$OpenBSD: patch-src_macro_c,v 1.2 2004/08/08 14:02:11 sturm Exp $
--- src/macro.c.orig	Mon May 17 16:05:11 2004
+++ src/macro.c	Mon Aug  2 13:30:35 2004
@@ -130,6 +130,7 @@ void AddMacroValue(char *scope,char *nam
 { char *sp, buffer[CF_BUFSIZE],exp[CF_EXPANDSIZE];
   struct cfObject *ptr; 
   int slot;
+  size_t buflen;
 
 Debug("AddMacroValue(%s.%s=%s)\n",scope,name,value);
 
@@ -151,13 +152,14 @@ ptr = ObjectContext(scope);
  
 snprintf(buffer,CF_BUFSIZE,"%s=%s",name,exp);
 
-if ((sp = malloc(strlen(buffer)+1)) == NULL)
+buflen = strlen(buffer) + 1;
+if ((sp = malloc(buflen)) == NULL)
    {
    perror("malloc");
    FatalError("aborting");
    }
 
-strcpy(sp,buffer);
+(void)strlcpy(sp,buffer,buflen);
 
 slot = Hash(name);
  
@@ -273,7 +275,7 @@ if (strstr(name,"."))
  
 if (ptr == NULL)
    {
-   strcpy(vname,name);
+   (void)strlcpy(vname,name,sizeof(vname));
    ptr = ObjectContext(scope);
    }
  
