diff options
author | Milan Crha <mcrha@redhat.com> | 2019-05-15 10:36:04 +0200 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2019-05-15 17:59:38 -0400 |
commit | 16e6583d2684e12b22f3df182815606a45e0ebf8 (patch) | |
tree | c603bdc76899c5b9dc492e60aea33c9b6434e634 | |
parent | a78b9ee8327cf8812ca8e37ec365b0f41a67309c (diff) | |
download | libical-git-16e6583d2684e12b22f3df182815606a45e0ebf8.tar.gz |
Fix the implementation of the i_cal_value_decode_ical_string() wrapper
The function should pass the buffer length including
the nul-terminating character. Change also the 'encode' wrapper
similarly.
-rw-r--r-- | src/libical-glib/api/i-cal-value.xml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libical-glib/api/i-cal-value.xml b/src/libical-glib/api/i-cal-value.xml index ed54e510..6320a961 100644 --- a/src/libical-glib/api/i-cal-value.xml +++ b/src/libical-glib/api/i-cal-value.xml @@ -86,8 +86,8 @@ g_return_val_if_fail(szText != NULL, NULL); - bufSize = 2 * strlen(szText); - szEncText = g_new0(gchar, bufSize + 1); + bufSize = 2 * strlen(szText) + 1; + szEncText = g_new0(gchar, bufSize); result = icalvalue_encode_ical_string(szText, szEncText, bufSize); if (result) @@ -107,8 +107,8 @@ g_return_val_if_fail (szText != NULL, NULL); - bufSize = strlen(szText); - szDecText = g_new0(gchar, bufSize + 1); + bufSize = strlen(szText) + 1; + szDecText = g_new0(gchar, bufSize); result = icalvalue_decode_ical_string(szText, szDecText, bufSize); if (result) |