aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libical/ChangeLog10
-rwxr-xr-xlibical/scripts/mkderivedvalues.pl4
-rw-r--r--libical/src/libical/icalderivedvalue.c.in4
3 files changed, 15 insertions, 3 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index a32d033ef3..97412a7fa7 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,13 @@
+2002-10-15 Rodrigo Moya <rodrigo@ximian.com>
+
+ Fixes #25153
+
+ * scripts/mkderivedvalues.pl: changed the _get functions for
+ string values to return a NULL if arguments are wrong
+
+ * src/libical/icalderivedvalue.c.in (icalvalue_get_x): return from
+ function if pointer checking fails.
+
2002-10-01 Ettore Perazzoli <ettore@ximian.com>
* src/libicalvcal/vcc.y: Allocate the right number of bytes when
diff --git a/libical/scripts/mkderivedvalues.pl b/libical/scripts/mkderivedvalues.pl
index e7ede34ae7..5009419eac 100755
--- a/libical/scripts/mkderivedvalues.pl
+++ b/libical/scripts/mkderivedvalues.pl
@@ -157,8 +157,10 @@ foreach $value (keys %h) {
if ($type =~ /char/){
$assign = "icalmemory_strdup(v);\n\n if (impl->data.v_string == 0){\n errno = ENOMEM;\n }\n";
+ $check_arg = "icalerror_check_arg_rz( (value!=0),\"value\");";
} else {
$assign = "v;";
+ $check_arg = "icalerror_check_arg( (value!=0),\"value\");";
}
my $union_data;
@@ -197,7 +199,7 @@ void icalvalue_set_${lc}(icalvalue* value, $type v) {\
print "\n impl->data.v_$union_data = $assign \n }\n";
print "$type\ icalvalue_get_${lc}(icalvalue* value)\ {\n\
- icalerror_check_arg( (value!=0),\"value\");\
+ $check_arg\
icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
return ((struct icalvalue_impl*)value)->data.v_${union_data};\n}\n";
diff --git a/libical/src/libical/icalderivedvalue.c.in b/libical/src/libical/icalderivedvalue.c.in
index 8dac43a788..3c4e73066b 100644
--- a/libical/src/libical/icalderivedvalue.c.in
+++ b/libical/src/libical/icalderivedvalue.c.in
@@ -3,7 +3,7 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
- $Id: icalderivedvalue.c.in,v 1.2 2001/09/10 21:54:44 federico Exp $
+ $Id: icalderivedvalue.c.in,v 1.3 2002/10/16 21:41:39 rodrigo Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@@ -113,7 +113,7 @@ void icalvalue_set_x(icalvalue* value, const char* v) {
}
const char* icalvalue_get_x(icalvalue* value) {
- icalerror_check_arg( (value!=0),"value");
+ icalerror_check_arg_rz( (value!=0),"value");
icalerror_check_value_type(value, ICAL_X_VALUE);
return ((struct icalvalue_impl*)value)->x_value;
}