File bsc1041216-part1.patch of Package libmicrohttpd

From ef49636130061c379821d60c58ef51468bf9e039 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Sun, 23 Apr 2017 19:21:35 +0200
Subject: replace sprintf() with MHD_snprintf_()


Index: libmicrohttpd-0.9.30/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd-0.9.30.orig/src/microhttpd/connection.c
+++ libmicrohttpd-0.9.30/src/microhttpd/connection.c
@@ -588,9 +588,11 @@ add_extra_headers (struct MHD_Connection
  *
  * @param date where to write the header, with
  *        at least 128 bytes available space.
+ * @param date_len number of bytes in @a date
  */
 static void
-get_date_string (char *date)
+get_date_string (char *date,
+		 size_t date_len)
 {
   static const char *const days[] =
     { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
@@ -702,7 +704,8 @@ build_header_response (struct MHD_Connec
       if ( (0 == (connection->daemon->options & MHD_SUPPRESS_DATE_NO_CLOCK)) && 
 	   (NULL == MHD_get_response_header (connection->response,
 					     MHD_HTTP_HEADER_DATE)) )
-        get_date_string (date);
+        get_date_string (date,
+			 sizeof (date));
       else
         date[0] = '\0';
       size += strlen (date);
openSUSE Build Service is sponsored by