$OpenBSD: patch-drivers_sec_c,v 1.1 2004/02/09 06:48:48 marcm Exp $
--- drivers/sec.c.orig	2004-01-03 10:22:53.000000000 -0800
+++ drivers/sec.c	2004-01-03 10:24:29.000000000 -0800
@@ -213,11 +213,11 @@ int sec_cmd(const char mode, const char 
 
     /* create the message string */
     if (*buflen > 0) {
-	sprintf(msg, "%c%c%03d%s%s", SEC_MSG_STARTCHAR,
+	snprintf(msg, sizeof (msg), "%c%c%03d%s%s", SEC_MSG_STARTCHAR,
 		mode, (*buflen)+3, command, msgbuf);
     }
     else {
-	sprintf(msg, "%c%c003%s", SEC_MSG_STARTCHAR,
+	snprintf(msg, sizeof (msg), "%c%c003%s", SEC_MSG_STARTCHAR,
 		mode, command);
     }	
     upsdebugx(1, "PC-->UPS: \"%s\"",msg);
