File maelstrom-3.0.6-myerror.cpp.patch of Package maelstrom

--- myerror.cpp.orig	1998-07-14 03:50:17.000000000 +0200
+++ myerror.cpp	2014-09-28 13:28:02.088439917 +0200
@@ -16,7 +16,8 @@
 	va_list ap;
 
 	va_start(ap, fmt);
-	vsprintf(mesg, fmt, ap);
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
+	
 	fputs(mesg, stderr);
 	va_end(ap);
 }
@@ -27,7 +28,7 @@
 	va_list ap;
 
 	va_start(ap, fmt);
-	vsprintf(mesg, fmt, ap);
+	vsnprintf(mesg, sizeof(mesg), fmt, ap);
 	fputs(mesg, stdout);
 	va_end(ap);
 }
@@ -37,8 +38,8 @@
 	char buffer[BUFSIZ];
 
 	if ( *msg ) {
-		sprintf(buffer, "%s: %s\n", msg, strerror(errno));
-		error(buffer);
+		snprintf(buffer, sizeof(buffer), "%s: %s\n", msg, strerror(errno));
+		error("%s", buffer);
 	} else
 		error((char *)strerror(errno));
 }
openSUSE Build Service is sponsored by