commit bcb8cb4e9d6c8e777fd43fbef905d11c1e0fbc23
parent 498b61cc586e6e258fb9299d14b49ec831ccb0f8
Author: wwp <wwp@free.fr>
Date: Sat, 14 Jan 2017 08:34:57 +0100
Revert part of 3.14.1-128-g498b61c, fixing Coverity CID #1398594.
Instead of really fixing the wrong call to g_strdup_printf, I prefer
not touching libical code, we'll see later what to do w/ it.
Diffstat:
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/plugins/vcalendar/libical/libical/icalproperty.c b/src/plugins/vcalendar/libical/libical/icalproperty.c
@@ -44,8 +44,8 @@
#include <errno.h>
#include <stdio.h> /* for printf */
#include <stdarg.h> /* for va_list, va_start, etc. */
-
-#define BUF_SIZE 1024
+
+#define TMP_BUF_SIZE 1024
/* Private routines for icalproperty */
void icalvalue_set_parent(icalvalue* value,
@@ -175,7 +175,7 @@ icalproperty_new_clone(icalproperty* prop)
icalproperty* icalproperty_new_from_string(char* str)
{
- size_t buf_size = BUF_SIZE;
+ size_t buf_size = 1024;
char* buf;
char* buf_ptr;
icalproperty *prop;
@@ -279,7 +279,7 @@ icalproperty_as_ical_string (icalproperty* prop)
the caller forgetting to free it */
const char* property_name = 0;
- size_t buf_size = BUF_SIZE;
+ size_t buf_size = 1024;
char* buf;
char* buf_ptr;
icalvalue* value;
@@ -381,10 +381,9 @@ icalproperty_as_ical_string (icalproperty* prop)
}
if (kind_string == 0 ) {
- char *temp;
- temp = g_strdup_printf(temp, "Got a parameter of unknown kind in %s property", property_name);
+ char temp[TMP_BUF_SIZE];
+ snprintf(temp, TMP_BUF_SIZE,"Got a parameter of unknown kind in %s property",property_name);
icalerror_warn(temp);
- g_free(temp);
continue;
}