$OpenBSD: patch-src_macro_c,v 1.5 2005/10/27 21:47:28 sturm Exp $
--- src/macro.c.orig	Mon Aug 15 10:06:46 2005
+++ src/macro.c	Fri Oct 21 16:35:56 2005
@@ -200,6 +200,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);
 
@@ -237,13 +238,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);
  
@@ -363,7 +365,7 @@ if (strstr(name,"."))
  
 if (ptr == NULL)
    {
-   strcpy(vname,name);
+   (void)strlcpy(vname,name,sizeof(vname));
    ptr = ObjectContext(scope);
    }
  
