evolution-data-server r9396 - branches/EXCHANGE_MAPI_BRANCH/servers/mapi
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9396 - branches/EXCHANGE_MAPI_BRANCH/servers/mapi
- Date: Tue, 19 Aug 2008 11:32:52 +0000 (UTC)
Author: msuman
Date: Tue Aug 19 11:32:52 2008
New Revision: 9396
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9396&view=rev
Log:
Fixed a few potential invalid memory accesses, minor alarm bug.
Modified:
branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c
branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c
branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h
Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c (original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-cal-utils.c Tue Aug 19 11:32:52 2008
@@ -1614,11 +1614,12 @@
if (action == E_CAL_COMPONENT_ALARM_DISPLAY) {
ECalComponentAlarmTrigger trigger;
e_cal_component_alarm_get_trigger (alarm, &trigger);
+ int dur_int = 0;
switch (trigger.type) {
case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START :
- flag32 = (icaldurationtype_as_int (trigger.u.rel_duration)) / SECS_IN_MINUTE;
+ dur_int = (icaldurationtype_as_int (trigger.u.rel_duration)) / SECS_IN_MINUTE;
/* we cannot set an alarm to popup after the start of an appointment on Exchange */
- flag32 = (flag32 < 0) ? -(flag32) : 0;
+ flag32 = (dur_int < 0) ? -(dur_int) : 0;
break;
default :
break;
Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c (original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.c Tue Aug 19 11:32:52 2008
@@ -107,30 +107,33 @@
/* NOTE: For now, since this function has special significance only for
* 'string' type properties, callers should (preferably) use it for fetching
* such properties alone. If callers are sure that proptag would, for instance,
- * return an 'int' or a 'systime', they should prefer find_SPropValue_data.
+ * return an 'int' or a 'systime', they should prefer get_SPropValue.
*/
-void *
+const void *
exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
- const char *str;
+ const void *str = NULL;
proptag = (proptag & 0xFFFF0000) | PT_STRING8;
- str = (const char *)get_SPropValue(values, proptag);
+ str = get_SPropValue(values, proptag);
if (str)
- return (void *)str;
+ return str;
proptag = (proptag & 0xFFFF0000) | PT_UNICODE;
- str = (const char *)get_SPropValue(values, proptag);
- return (void *)str;
+ str = get_SPropValue(values, proptag);
+ if (str)
+ return str;
+
+ return NULL;
}
/* NOTE: Similar generalizations (if any) for other property types
* can be made here.
*/
- return (void *)get_SPropValue(values, proptag);
+ return (get_SPropValue(values, proptag));
}
/*
@@ -146,28 +149,31 @@
* such properties alone. If callers are sure that proptag would, for instance,
* return an 'int' or a 'systime', they should prefer find_SPropValue_data.
*/
-void *
+const void *
exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
- const char *str;
+ const void *str = NULL;
proptag = (proptag & 0xFFFF0000) | PT_STRING8;
- str = (const char *)find_SPropValue_data(aRow, proptag);
+ str = find_SPropValue_data(aRow, proptag);
if (str)
- return (void *)str;
+ return str;
proptag = (proptag & 0xFFFF0000) | PT_UNICODE;
- str = (const char *)find_SPropValue_data(aRow, proptag);
- return (void *)str;
+ str = find_SPropValue_data(aRow, proptag);
+ if (str)
+ return str;
+
+ return NULL;
}
/* NOTE: Similar generalizations (if any) for other property types
* can be made here.
*/
- return (void *)find_SPropValue_data(aRow, proptag);
+ return (find_SPropValue_data(aRow, proptag));
}
/*
@@ -183,28 +189,31 @@
* such properties alone. If callers are sure that proptag would, for instance,
* return an 'int' or a 'systime', they should prefer find_mapi_SPropValue_data.
*/
-void *
+const void *
exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag)
{
if (((proptag & 0xFFFF) == PT_STRING8) ||
((proptag & 0xFFFF) == PT_UNICODE)) {
- const char *str;
+ const void *str = NULL;
proptag = (proptag & 0xFFFF0000) | PT_STRING8;
- str = (const char *)find_mapi_SPropValue_data(properties, proptag);
+ str = find_mapi_SPropValue_data(properties, proptag);
if (str)
- return (void *)str;
+ return str;
proptag = (proptag & 0xFFFF0000) | PT_UNICODE;
- str = (const char *)find_mapi_SPropValue_data(properties, proptag);
- return (void *)str;
+ str = find_mapi_SPropValue_data(properties, proptag);
+ if (str)
+ return str;
+
+ return NULL;
}
/* NOTE: Similar generalizations (if any) for other property types
* can be made here.
*/
- return (void *)find_mapi_SPropValue_data(properties, proptag);
+ return (find_mapi_SPropValue_data(properties, proptag));
}
ExchangeMAPIStream *
Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h (original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-utils.h Tue Aug 19 11:32:52 2008
@@ -41,11 +41,11 @@
gboolean
exchange_mapi_util_mapi_ids_from_uid (const char *str, mapi_id_t *fid, mapi_id_t *mid);
-void *
+const void *
exchange_mapi_util_find_SPropVal_array_propval (struct SPropValue *values, uint32_t proptag);
-void *
+const void *
exchange_mapi_util_find_row_propval (struct SRow *aRow, uint32_t proptag);
-void *
+const void *
exchange_mapi_util_find_array_propval (struct mapi_SPropValue_array *properties, uint32_t proptag);
ExchangeMAPIStream *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]