View | Details | Raw Unified | Return to bug 211257 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-string_int_h (+13 lines)
Line 0 Link Here
1
--- include/xmlrpc-c/string_int.h.orig 2016-08-01 22:12:28 UTC
2
+++ include/xmlrpc-c/string_int.h
3
@@ -121,8 +121,8 @@ xmlrpc_makePrintableChar(char const inpu
4
 	(strncpy((A), (B), sizeof(A)), *((A)+sizeof(A)-1) = '\0')
5
 #define STRSCMP(A,B) \
6
 	(strncmp((A), (B), sizeof(A)))
7
-#define STRSCAT(A,B) \
8
-    (strncat((A), (B), sizeof(A)-strlen(A)), *((A)+sizeof(A)-1) = '\0')
9
+#define STRNSCAT(A,B) \
10
+    (strncat((A), (B), sizeof(A)-strlen(A)-1), *((A)+sizeof(A)-1) = '\0')
11
 
12
 /* We could do this, but it works only in GNU C 
13
 #define SSPRINTF(TARGET, REST...) \
(-)files/patch-xmlrpc_datetime_c (+11 lines)
Line 0 Link Here
1
--- src/xmlrpc_datetime.c.orig	2016-08-01 22:11:50 UTC
2
+++ src/xmlrpc_datetime.c
3
@@ -161,7 +161,7 @@ xmlrpc_read_datetime_str(xmlrpc_env *   
4
                 assert(usecs < 1000000);
5
                 XMLRPC_SNPRINTF(usecString, sizeof(usecString),
6
                                 ".%06u", usecs);
7
-                STRSCAT(dtString, usecString);
8
+                STRNSCAT(dtString, usecString);
9
             }
10
 
11
             *stringValueP = strdup(dtString);
(-)files/patch-xmlrpc_serialize_c (+12 lines)
Line 0 Link Here
1
--- src/xmlrpc_serialize.c.orig	2016-08-01 22:11:23 UTC
2
+++ src/xmlrpc_serialize.c
3
@@ -305,7 +305,8 @@ serializeDatetime(xmlrpc_env *       con
4
             assert(valueP->_value.dt.u < 1000000);
5
             XMLRPC_SNPRINTF(usecString, sizeof(usecString), ".%06u",
6
                             valueP->_value.dt.u);
7
-            STRSCAT(dtString, usecString);
8
+            STRNSCAT(dtString, usecString);
9
+
10
         }
11
         addString(envP, outputP, dtString);
12
 

Return to bug 211257