aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-10-17 05:41:39 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-10-17 05:41:39 +0800
commitdcfed36441f2a937ee8ae1f604b7d1f0a5bc5719 (patch)
treef3aa34a5aa32aea1cd9d370ca3bb894dac64123a
parent19ebd1a8475274e074a3fad27dcf326a162bc1ff (diff)
downloadgsoc2013-evolution-dcfed36441f2a937ee8ae1f604b7d1f0a5bc5719.tar.gz
gsoc2013-evolution-dcfed36441f2a937ee8ae1f604b7d1f0a5bc5719.tar.zst
gsoc2013-evolution-dcfed36441f2a937ee8ae1f604b7d1f0a5bc5719.zip
Fixes #25153
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. svn path=/trunk/; revision=18378
-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;
}