summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-03 10:44:35 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-03 10:44:35 -0400
commit8b681837b7345b720dd57e81bb3dbf726577422a (patch)
tree350d639873689166b282407b19e6c4a988f8263d
parent7830c1a2b35799929c5544a93d8cbf201d91055a (diff)
downloadlibical-git-8b681837b7345b720dd57e81bb3dbf726577422a.tar.gz
suppress some coverity issues
supress coverity issues that we can't fix
-rw-r--r--src/libical/icalrestriction.c.in25
-rw-r--r--src/libicalss/icalssyacc.c3
2 files changed, 19 insertions, 9 deletions
diff --git a/src/libical/icalrestriction.c.in b/src/libical/icalrestriction.c.in
index e36773f1..3931fcb0 100644
--- a/src/libical/icalrestriction.c.in
+++ b/src/libical/icalrestriction.c.in
@@ -331,19 +331,24 @@ static int icalrestriction_check_component(icalproperty_method method, icalcompo
assert(compare != -1);
if (compare == 0) {
-#define TMP_BUF_SIZE 1024
+#if !defined(__COVERITY__)
+ /* Coverity doesn't think the memory allocated by icalparameter_new_xlicerrortype()
+ * is freed, even though it should be freed in icalproperty_free()
+ */
+ #define TMP_BUF_SIZE 1024
char temp[TMP_BUF_SIZE];
icalproperty *errProp;
- icalparameter *errParam;
snprintf(temp, TMP_BUF_SIZE,
"Failed iTIP restrictions for %s property. "
"Expected %s instances of the property and got %d",
icalenum_property_kind_to_string(kind), restr_string_map[restr], count);
- errParam = icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP);
- errProp = icalproperty_vanew_xlicerror(temp, errParam, 0);
+ errProp =
+ icalproperty_vanew_xlicerror(
+ temp, icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP), 0);
icalcomponent_add_property(comp, errProp);
icalproperty_free(errProp);
+#endif
}
prop = icalcomponent_get_first_property(comp, kind);
@@ -353,15 +358,19 @@ static int icalrestriction_check_component(icalproperty_method method, icalcompo
}
if (funcr != 0) {
+#if !defined(__COVERITY__)
+ /* Coverity doesn't think the memory allocated by icalparameter_new_xlicerrortype()
+ * is freed, even though it should be freed in icalproperty_free()
+ */
icalproperty *errProp;
- icalparameter *errParam;
- errParam = icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP);
- errProp = icalproperty_vanew_xlicerror(funcr, errParam, 0);
+ errProp =
+ icalproperty_vanew_xlicerror(
+ funcr, icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP), 0);
icalcomponent_add_property(comp, errProp);
icalproperty_free(errProp);
-
compare = 0;
+#endif
}
valid = valid && compare;
diff --git a/src/libicalss/icalssyacc.c b/src/libicalss/icalssyacc.c
index 61b1f502..2416e528 100644
--- a/src/libicalss/icalssyacc.c
+++ b/src/libicalss/icalssyacc.c
@@ -1317,6 +1317,7 @@ yyparse ()
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
+ /* coverity[OVERRUN] */
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
@@ -1418,9 +1419,9 @@ yyreduce:
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
+ /* coverity[uninit_use] */
yyval = yyvsp[1-yylen];
-
YY_REDUCE_PRINT (yyn);
switch (yyn)
{