File pacemaker-libcrmcommon-possible-infloop-in-buffer_print.patch of Package pacemaker.14737
commit f088b87c09786b666384bd49bc82cfd577d2bb35
Author: Jan Pokorný <jpokorny@redhat.com>
Date: Tue Sep 22 16:56:06 2015 +0200
Medium: libcrmcommon: fix possible infloop in buffer_print
Do not expect snprintf to be self-healed without changing the
circumstances.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
diff --git a/lib/common/xml.c b/lib/common/xml.c
index 86810cf63..ea0adb7c1 100644
--- a/lib/common/xml.c
+++ b/lib/common/xml.c
@@ -129,6 +129,7 @@ static inline bool TRACKING_CHANGES(xmlNode *xml)
if(buffer && rc < 0) { \
crm_perror(LOG_ERR, "snprintf failed at offset %d", offset); \
(buffer)[(offset)] = 0; \
+ break; \
} else if(rc >= ((max) - (offset))) { \
char *tmp = NULL; \
(max) = QB_MAX(CHUNK_SIZE, (max) * 2); \