[PATCH] AVIS: Align avis payload with payload tests (fix core dumps).


Lee Skillen <lskillen@...>
 

Avis core dumps under the existing payload unit tests due to lacking NULL and
invalid argument checks - Fix these so it runs cleanly (still fails aspects but
that's preferable to coring).

Signed-off-by: Lee Skillen <lskillen@vulcanft.com>
---
mama/c_cpp/src/c/payload/avismsg/avispayload.c | 135 +++++++++++++++++++++++--
1 file changed, 128 insertions(+), 7 deletions(-)

diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.c b/mama/c_cpp/src/c/payload/avismsg/avispayload.c
index c738868..66036cc 100755
--- a/mama/c_cpp/src/c/payload/avismsg/avispayload.c
+++ b/mama/c_cpp/src/c/payload/avismsg/avispayload.c
@@ -45,7 +45,7 @@

#define CHECK_PAYLOAD(msg) \
do { \
- if ((avisPayload(msg)) == 0) return MAMA_STATUS_NULL_ARG; \
+ if (!msg || !avisPayload(msg)) return MAMA_STATUS_NULL_ARG; \
} while(0)

#define CHECK_NAME(name,fid) \
@@ -54,7 +54,6 @@
if ((fid == 0) && (strlen(name)== 0)) return MAMA_STATUS_INVALID_ARG; \
} while(0)

-
#define CHECK_ITER(iter) \
do { \
if (((avisMsgIteratorImpl*)(iter)) == 0) return MAMA_STATUS_NULL_ARG; \
@@ -64,9 +63,13 @@

#define CHECK_FIELD(field) \
do { \
- if (avisField(field) == 0) return MAMA_STATUS_NULL_ARG; \
+ if (!field || !avisField(field)) return MAMA_STATUS_NULL_ARG; \
} while(0)

+#define CHECK_NULL(x) \
+ do { \
+ if (!x) return MAMA_STATUS_NULL_ARG; \
+ } while(0)

msgFieldPayload
avismsgPayloadIter_get (msgPayloadIter iter,
@@ -98,7 +101,7 @@ avismsgPayload_createImpl (mamaPayloadBridge* result, char* identifier)
mamaPayloadBridgeImpl* impl = NULL;
mama_status resultStatus = MAMA_STATUS_OK;

- if (!result) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (result);

impl = (mamaPayloadBridgeImpl*)calloc (1, sizeof (mamaPayloadBridgeImpl));
if (!impl)
@@ -160,6 +163,10 @@ avismsgPayload_createForTemplate (msgPayload* msg,
mama_status
avismsgPayload_createFromByteBuffer(msgPayload* msg, mamaPayloadBridge bridge, const void* buffer, mama_size_t bufferLength)
{
+ CHECK_NULL (msg);
+ CHECK_NULL (bridge);
+ CHECK_NULL (buffer);
+
avisPayloadImpl* newPayload = (avisPayloadImpl*)calloc (1, sizeof(avisPayloadImpl));

if (buffer != NULL)
@@ -209,7 +216,7 @@ avismsgPayload_setParent (msgPayload msg,
const mamaMsg parent)
{
avisPayloadImpl* impl = (avisPayloadImpl*) msg;
- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

impl->mParent = parent;

@@ -221,6 +228,7 @@ avismsgPayload_getByteSize (const msgPayload msg,
mama_size_t* size)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL(size);
*size = 0;
return MAMA_STATUS_NOT_IMPLEMENTED;
}
@@ -240,6 +248,9 @@ avismsgPayload_unSerialize (const msgPayload msg,
uint16_t len =0;
uint8_t * buffPos = (void*)buffer;

+ CHECK_PAYLOAD (msg);
+ CHECK_NULL (buffer);
+
if (!impl->mAvisMsg)
impl->mAvisMsg = attributes_create();
else
@@ -313,6 +324,10 @@ avismsgPayload_serialize (const msgPayload msg,
uint32_t currLen = 0;
avisFieldPayload* currField = NULL;

+ CHECK_PAYLOAD (msg);
+ CHECK_NULL (buffer);
+ CHECK_NULL (bufferLength);
+
if (!impl->mIterator)
{
status = avismsgPayloadIter_create((msgPayloadIter*) &impl->mIterator, msg);
@@ -429,6 +444,8 @@ avismsgPayload_getByteBuffer (const msgPayload msg,
{
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
CHECK_PAYLOAD(msg);
+ CHECK_NULL (buffer);
+ CHECK_NULL (bufferLength);

*buffer = impl->mAvisMsg;

@@ -465,6 +482,7 @@ avismsgPayload_getNumFields (const msgPayload msg,
mama_size_t* numFields)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL(numFields);
*numFields = attributes_size(avisPayload(msg));
return MAMA_STATUS_OK;
}
@@ -472,6 +490,7 @@ avismsgPayload_getNumFields (const msgPayload msg,
const char*
avismsgPayload_toString (const msgPayload msg)
{
+ if (!msg) return NULL;
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
mama_status status = MAMA_STATUS_OK;
char *strpos = NULL;
@@ -542,6 +561,8 @@ avismsgPayload_iterateFields (const msgPayload msg,
mamaMsgIteratorCb cb,
void* closure)
{
+ CHECK_PAYLOAD (msg);
+
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
mama_status status = MAMA_STATUS_OK;
avisFieldPayload* currField = NULL;
@@ -637,6 +658,7 @@ avismsgPayload_getNativeMsg (const msgPayload msg,
void** nativeMsg)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL (nativeMsg);
*nativeMsg = msg;
return MAMA_STATUS_OK;
}
@@ -786,6 +808,7 @@ avismsgPayload_addString (msgPayload msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), name, fid, value);
}

@@ -798,6 +821,7 @@ avismsgPayload_addOpaque (msgPayload msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setOpaque(avisPayload(msg), name, fid, value, size);
}

@@ -1039,6 +1063,8 @@ avismsgPayload_updateBool (msgPayload msg,
mama_fid_t fid,
mama_bool_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setBool(avisPayload(msg), name, fid, value);
}

@@ -1048,6 +1074,8 @@ avismsgPayload_updateChar (msgPayload msg,
mama_fid_t fid,
char value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setChar(avisPayload(msg), name, fid, value);
}

@@ -1057,6 +1085,8 @@ avismsgPayload_updateU8 (msgPayload msg,
mama_fid_t fid,
mama_u8_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI8(avisPayload(msg), name, fid, value);
}

@@ -1066,6 +1096,8 @@ avismsgPayload_updateI8 (msgPayload msg,
mama_fid_t fid,
mama_i8_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU8(avisPayload(msg), name, fid, value);
}

@@ -1075,6 +1107,8 @@ avismsgPayload_updateI16 (msgPayload msg,
mama_fid_t fid,
mama_i16_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI16(avisPayload(msg), name, fid, value);
}

@@ -1084,6 +1118,8 @@ avismsgPayload_updateU16 (msgPayload msg,
mama_fid_t fid,
mama_u16_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU16(avisPayload(msg), name, fid, value);
}

@@ -1093,6 +1129,8 @@ avismsgPayload_updateI32 (msgPayload msg,
mama_fid_t fid,
mama_i32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI32(avisPayload(msg), name, fid, value);
}

@@ -1102,6 +1140,8 @@ avismsgPayload_updateU32 (msgPayload msg,
mama_fid_t fid,
mama_u32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU32(avisPayload(msg), name, fid, value);
}

@@ -1111,6 +1151,8 @@ avismsgPayload_updateI64 (msgPayload msg,
mama_fid_t fid,
mama_i64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI64(avisPayload(msg), name, fid, value);
}

@@ -1120,6 +1162,8 @@ avismsgPayload_updateU64 (msgPayload msg,
mama_fid_t fid,
mama_u64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU64(avisPayload(msg), name, fid, value);
}

@@ -1129,6 +1173,8 @@ avismsgPayload_updateF32 (msgPayload msg,
mama_fid_t fid,
mama_f32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setF32(avisPayload(msg), name, fid, value);
}

@@ -1138,6 +1184,8 @@ avismsgPayload_updateF64 (msgPayload msg,
mama_fid_t fid,
mama_f64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setF64(avisPayload(msg), name, fid, value);
}

@@ -1147,6 +1195,9 @@ avismsgPayload_updateString (msgPayload msg,
mama_fid_t fid,
const char* value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), name, fid, value);
}

@@ -1157,6 +1208,9 @@ avismsgPayload_updateOpaque (msgPayload msg,
const void* value,
mama_size_t size)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setOpaque(avisPayload(msg), name, fid, value, size);
}

@@ -1534,6 +1588,7 @@ avismsgPayload_getString (const msgPayload msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (result);
return avisMsg_getString(avisPayload(msg), name, fid, result);
}

@@ -1546,6 +1601,7 @@ avismsgPayload_getOpaque (const msgPayload msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (result);
return avisMsg_getOpaque(avisPayload(msg), name, fid, result, size);
}

@@ -1561,6 +1617,7 @@ avismsgPayload_getField (const msgPayload msg,
Value* pValue = NULL;
CHECK_PAYLOAD(msg);
CHECK_NAME(name, fid);
+ CHECK_NULL (result);

if ( (!impl->mAvisField) && (avismsgFieldPayload_create((msgFieldPayload*) &impl->mAvisField) != MAMA_STATUS_OK) ) {
return MAMA_STATUS_PLATFORM;
@@ -1829,6 +1886,7 @@ avismsgPayloadIter_create (msgPayloadIter* iter,
mama_status status = MAMA_STATUS_OK;
avisIterator* impl = NULL;
CHECK_PAYLOAD(msg);
+ CHECK_NULL (iter);

impl = calloc (1, sizeof (avisIterator));
if (!impl) return (MAMA_STATUS_NOMEM);
@@ -1846,6 +1904,13 @@ avismsgPayloadIter_create (msgPayloadIter* iter,
return status;
}

+ if (!impl->mAvisMsg)
+ {
+ status = avismsgPayloadIter_associate(impl, msg);
+ if (status != MAMA_STATUS_OK)
+ return status;
+ }
+
*iter = (msgPayloadIter) impl;
return (status);
}
@@ -1861,6 +1926,11 @@ avismsgPayloadIter_get (msgPayloadIter iter,
avisField(field)->mName = attributes_iter_name(impl->mMsgIterator);
avisField(field)->mValue = attributes_iter_value(impl->mMsgIterator);

+ if (!avisField(field)->mName)
+ {
+ return NULL;
+ }
+
if ((strcmp(SUBJECT_FIELD_NAME, avisField(field)->mName) == 0) ||
(strcmp(INBOX_FIELD_NAME, avisField(field)->mName)== 0))
return (avismsgPayloadIter_next(iter,field,msg));
@@ -1918,7 +1988,7 @@ avismsgPayloadIter_associate (msgPayloadIter iter,
avisIterator* impl = (avisIterator*) iter;
CHECK_PAYLOAD(msg);

- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

attributes_iter_init(impl->mMsgIterator, avisPayload(msg));
impl->mAvisMsg = avisPayload(msg);
@@ -1929,7 +1999,7 @@ mama_status
avismsgPayloadIter_destroy (msgPayloadIter iter)
{
avisIterator* impl = (avisIterator*) iter;
- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

if (impl->mMsgIterator)
attributes_iter_destroy(impl->mMsgIterator);
@@ -2088,6 +2158,8 @@ avismsgFieldPayload_updateBool (msgFieldPayload field,
msgPayload msg,
mama_bool_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setBool(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2096,6 +2168,8 @@ avismsgFieldPayload_updateChar (msgFieldPayload field,
msgPayload msg,
char value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setChar(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2104,6 +2178,8 @@ avismsgFieldPayload_updateU8 (msgFieldPayload field,
msgPayload msg,
mama_u8_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU8(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2112,6 +2188,8 @@ avismsgFieldPayload_updateI8 (msgFieldPayload field,
msgPayload msg,
mama_i8_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI8(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2120,6 +2198,8 @@ avismsgFieldPayload_updateI16 (msgFieldPayload field,
msgPayload msg,
mama_i16_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI16(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2128,6 +2208,8 @@ avismsgFieldPayload_updateU16 (msgFieldPayload field,
msgPayload msg,
mama_u16_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU16(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2136,6 +2218,8 @@ avismsgFieldPayload_updateI32 (msgFieldPayload field,
msgPayload msg,
mama_i32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI32(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2144,6 +2228,8 @@ avismsgFieldPayload_updateU32 (msgFieldPayload field,
msgPayload msg,
mama_u32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU32(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2152,6 +2238,8 @@ avismsgFieldPayload_updateI64 (msgFieldPayload field,
msgPayload msg,
mama_i64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI64(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2160,6 +2248,8 @@ avismsgFieldPayload_updateU64 (msgFieldPayload field,
msgPayload msg,
mama_u64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU64(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2168,6 +2258,8 @@ avismsgFieldPayload_updateF32 (msgFieldPayload field,
msgPayload msg,
mama_f32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setF32(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2176,6 +2268,8 @@ avismsgFieldPayload_updateF64 (msgFieldPayload field,
msgPayload msg,
mama_f64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setF64(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2185,6 +2279,8 @@ avismsgFieldPayload_updateDateTime
msgPayload msg,
const mamaDateTime value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setDateTime(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2193,6 +2289,8 @@ avismsgFieldPayload_updatePrice (msgFieldPayload field,
msgPayload msg,
const mamaPrice value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setPrice(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2201,6 +2299,9 @@ avismsgFieldPayload_updateString (msgFieldPayload field,
msgPayload msg,
const char* value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), avisField(field)->mName, 0, value);
}

@@ -2211,6 +2312,7 @@ mama_status
avismsgFieldPayload_getBool (const msgFieldPayload field,
mama_bool_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getBool(avisField(field)->mValue, result);
}

@@ -2218,6 +2320,7 @@ mama_status
avismsgFieldPayload_getChar (const msgFieldPayload field,
char* result)
{
+ CHECK_FIELD(field);
return avisValue_getChar(avisField(field)->mValue, result);
}

@@ -2225,6 +2328,7 @@ mama_status
avismsgFieldPayload_getI8 (const msgFieldPayload field,
mama_i8_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI8(avisField(field)->mValue, result);
}

@@ -2232,6 +2336,7 @@ mama_status
avismsgFieldPayload_getU8 (const msgFieldPayload field,
mama_u8_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU8(avisField(field)->mValue, result);
}

@@ -2239,6 +2344,7 @@ mama_status
avismsgFieldPayload_getI16 (const msgFieldPayload field,
mama_i16_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI16(avisField(field)->mValue, result);
}

@@ -2246,6 +2352,7 @@ mama_status
avismsgFieldPayload_getU16 (const msgFieldPayload field,
mama_u16_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU16(avisField(field)->mValue, result);
}

@@ -2253,6 +2360,7 @@ mama_status
avismsgFieldPayload_getI32 (const msgFieldPayload field,
mama_i32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI32(avisField(field)->mValue, result);
}

@@ -2260,6 +2368,7 @@ mama_status
avismsgFieldPayload_getU32 (const msgFieldPayload field,
mama_u32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU32(avisField(field)->mValue, result);
}

@@ -2267,6 +2376,7 @@ mama_status
avismsgFieldPayload_getI64 (const msgFieldPayload field,
mama_i64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI64(avisField(field)->mValue, result);
}

@@ -2274,6 +2384,7 @@ mama_status
avismsgFieldPayload_getU64 (const msgFieldPayload field,
mama_u64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU64(avisField(field)->mValue, result);
}

@@ -2281,6 +2392,7 @@ mama_status
avismsgFieldPayload_getF32 (const msgFieldPayload field,
mama_f32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getF32(avisField(field)->mValue, result);
}

@@ -2288,6 +2400,7 @@ mama_status
avismsgFieldPayload_getF64 (const msgFieldPayload field,
mama_f64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getF64(avisField(field)->mValue, result);
}

@@ -2295,6 +2408,8 @@ mama_status
avismsgFieldPayload_getString (const msgFieldPayload field,
const char** result)
{
+ CHECK_FIELD(field);
+ CHECK_NULL (result);
return avisValue_getString(avisField(field)->mValue, result);
}

@@ -2303,6 +2418,9 @@ avismsgFieldPayload_getOpaque (const msgFieldPayload field,
const void** result,
mama_size_t* size)
{
+ CHECK_FIELD(field);
+ CHECK_NULL (result);
+ CHECK_NULL (size);
return avisValue_getOpaque(avisField(field)->mValue, result, size);
}

@@ -2310,6 +2428,7 @@ mama_status
avismsgFieldPayload_getDateTime (const msgFieldPayload field,
mamaDateTime result)
{
+ CHECK_FIELD(field);
return avisValue_getDateTime(avisField(field)->mValue, result);
}

@@ -2317,6 +2436,7 @@ mama_status
avismsgFieldPayload_getPrice (const msgFieldPayload field,
mamaPrice result)
{
+ CHECK_FIELD(field);
return avisValue_getPrice(avisField(field)->mValue, result);
}

@@ -2324,6 +2444,7 @@ mama_status
avismsgFieldPayload_getMsg (const msgFieldPayload field,
msgPayload* result)
{
+ CHECK_FIELD(field);
return MAMA_STATUS_NOT_IMPLEMENTED;
}

--
1.9.0


Damian Maguire <DMaguire@...>
 

Hey Lee,

As before, this has been raised to Bugzilla for tracking. Ticket Number:
http://bugs.openmama.org/show_bug.cgi?id=77

Cheers,

D



On 3/10/14 2:07 PM, "Lee Skillen" <lskillen@vulcanft.com> wrote:

Avis core dumps under the existing payload unit tests due to lacking NULL
and
invalid argument checks - Fix these so it runs cleanly (still fails
aspects but
that's preferable to coring).

Signed-off-by: Lee Skillen <lskillen@vulcanft.com>
---
mama/c_cpp/src/c/payload/avismsg/avispayload.c | 135
+++++++++++++++++++++++--
1 file changed, 128 insertions(+), 7 deletions(-)

diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.c
b/mama/c_cpp/src/c/payload/avismsg/avispayload.c
index c738868..66036cc 100755
--- a/mama/c_cpp/src/c/payload/avismsg/avispayload.c
+++ b/mama/c_cpp/src/c/payload/avismsg/avispayload.c
@@ -45,7 +45,7 @@

#define CHECK_PAYLOAD(msg) \
do { \
- if ((avisPayload(msg)) == 0) return MAMA_STATUS_NULL_ARG; \
+ if (!msg || !avisPayload(msg)) return MAMA_STATUS_NULL_ARG; \
} while(0)

#define CHECK_NAME(name,fid) \
@@ -54,7 +54,6 @@
if ((fid == 0) && (strlen(name)== 0)) return
MAMA_STATUS_INVALID_ARG; \
} while(0)

-
#define CHECK_ITER(iter) \
do { \
if (((avisMsgIteratorImpl*)(iter)) == 0) return
MAMA_STATUS_NULL_ARG; \
@@ -64,9 +63,13 @@

#define CHECK_FIELD(field) \
do { \
- if (avisField(field) == 0) return MAMA_STATUS_NULL_ARG; \
+ if (!field || !avisField(field)) return MAMA_STATUS_NULL_ARG;
\
} while(0)

+#define CHECK_NULL(x) \
+ do { \
+ if (!x) return MAMA_STATUS_NULL_ARG; \
+ } while(0)

msgFieldPayload
avismsgPayloadIter_get (msgPayloadIter iter,
@@ -98,7 +101,7 @@ avismsgPayload_createImpl (mamaPayloadBridge* result,
char* identifier)
mamaPayloadBridgeImpl* impl = NULL;
mama_status resultStatus = MAMA_STATUS_OK;

- if (!result) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (result);

impl = (mamaPayloadBridgeImpl*)calloc (1, sizeof
(mamaPayloadBridgeImpl));
if (!impl)
@@ -160,6 +163,10 @@ avismsgPayload_createForTemplate (msgPayload*
msg,
mama_status
avismsgPayload_createFromByteBuffer(msgPayload* msg, mamaPayloadBridge
bridge, const void* buffer, mama_size_t bufferLength)
{
+ CHECK_NULL (msg);
+ CHECK_NULL (bridge);
+ CHECK_NULL (buffer);
+
avisPayloadImpl* newPayload = (avisPayloadImpl*)calloc (1,
sizeof(avisPayloadImpl));

if (buffer != NULL)
@@ -209,7 +216,7 @@ avismsgPayload_setParent (msgPayload msg,
const mamaMsg parent)
{
avisPayloadImpl* impl = (avisPayloadImpl*) msg;
- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

impl->mParent = parent;

@@ -221,6 +228,7 @@ avismsgPayload_getByteSize (const msgPayload
msg,
mama_size_t* size)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL(size);
*size = 0;
return MAMA_STATUS_NOT_IMPLEMENTED;
}
@@ -240,6 +248,9 @@ avismsgPayload_unSerialize (const msgPayload msg,
uint16_t len =0;
uint8_t * buffPos = (void*)buffer;

+ CHECK_PAYLOAD (msg);
+ CHECK_NULL (buffer);
+
if (!impl->mAvisMsg)
impl->mAvisMsg = attributes_create();
else
@@ -313,6 +324,10 @@ avismsgPayload_serialize (const msgPayload
msg,
uint32_t currLen = 0;
avisFieldPayload* currField = NULL;

+ CHECK_PAYLOAD (msg);
+ CHECK_NULL (buffer);
+ CHECK_NULL (bufferLength);
+
if (!impl->mIterator)
{
status = avismsgPayloadIter_create((msgPayloadIter*)
&impl->mIterator, msg);
@@ -429,6 +444,8 @@ avismsgPayload_getByteBuffer (const msgPayload
msg,
{
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
CHECK_PAYLOAD(msg);
+ CHECK_NULL (buffer);
+ CHECK_NULL (bufferLength);

*buffer = impl->mAvisMsg;

@@ -465,6 +482,7 @@ avismsgPayload_getNumFields (const msgPayload
msg,
mama_size_t* numFields)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL(numFields);
*numFields = attributes_size(avisPayload(msg));
return MAMA_STATUS_OK;
}
@@ -472,6 +490,7 @@ avismsgPayload_getNumFields (const msgPayload
msg,
const char*
avismsgPayload_toString (const msgPayload msg)
{
+ if (!msg) return NULL;
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
mama_status status = MAMA_STATUS_OK;
char *strpos = NULL;
@@ -542,6 +561,8 @@ avismsgPayload_iterateFields (const msgPayload
msg,
mamaMsgIteratorCb cb,
void* closure)
{
+ CHECK_PAYLOAD (msg);
+
avisPayloadImpl* impl = (avisPayloadImpl*)msg;
mama_status status = MAMA_STATUS_OK;
avisFieldPayload* currField = NULL;
@@ -637,6 +658,7 @@ avismsgPayload_getNativeMsg (const msgPayload
msg,
void** nativeMsg)
{
CHECK_PAYLOAD(msg);
+ CHECK_NULL (nativeMsg);
*nativeMsg = msg;
return MAMA_STATUS_OK;
}
@@ -786,6 +808,7 @@ avismsgPayload_addString (msgPayload
msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), name, fid, value);
}

@@ -798,6 +821,7 @@ avismsgPayload_addOpaque (msgPayload
msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setOpaque(avisPayload(msg), name, fid, value, size);
}

@@ -1039,6 +1063,8 @@ avismsgPayload_updateBool (msgPayload
msg,
mama_fid_t fid,
mama_bool_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setBool(avisPayload(msg), name, fid, value);
}

@@ -1048,6 +1074,8 @@ avismsgPayload_updateChar (msgPayload
msg,
mama_fid_t fid,
char value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setChar(avisPayload(msg), name, fid, value);
}

@@ -1057,6 +1085,8 @@ avismsgPayload_updateU8 (msgPayload
msg,
mama_fid_t fid,
mama_u8_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI8(avisPayload(msg), name, fid, value);
}

@@ -1066,6 +1096,8 @@ avismsgPayload_updateI8 (msgPayload
msg,
mama_fid_t fid,
mama_i8_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU8(avisPayload(msg), name, fid, value);
}

@@ -1075,6 +1107,8 @@ avismsgPayload_updateI16 (msgPayload
msg,
mama_fid_t fid,
mama_i16_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI16(avisPayload(msg), name, fid, value);
}

@@ -1084,6 +1118,8 @@ avismsgPayload_updateU16 (msgPayload
msg,
mama_fid_t fid,
mama_u16_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU16(avisPayload(msg), name, fid, value);
}

@@ -1093,6 +1129,8 @@ avismsgPayload_updateI32 (msgPayload
msg,
mama_fid_t fid,
mama_i32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI32(avisPayload(msg), name, fid, value);
}

@@ -1102,6 +1140,8 @@ avismsgPayload_updateU32 (msgPayload
msg,
mama_fid_t fid,
mama_u32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU32(avisPayload(msg), name, fid, value);
}

@@ -1111,6 +1151,8 @@ avismsgPayload_updateI64 (msgPayload
msg,
mama_fid_t fid,
mama_i64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setI64(avisPayload(msg), name, fid, value);
}

@@ -1120,6 +1162,8 @@ avismsgPayload_updateU64 (msgPayload
msg,
mama_fid_t fid,
mama_u64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setU64(avisPayload(msg), name, fid, value);
}

@@ -1129,6 +1173,8 @@ avismsgPayload_updateF32 (msgPayload
msg,
mama_fid_t fid,
mama_f32_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setF32(avisPayload(msg), name, fid, value);
}

@@ -1138,6 +1184,8 @@ avismsgPayload_updateF64 (msgPayload
msg,
mama_fid_t fid,
mama_f64_t value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
return avisMsg_setF64(avisPayload(msg), name, fid, value);
}

@@ -1147,6 +1195,9 @@ avismsgPayload_updateString (msgPayload
msg,
mama_fid_t fid,
const char* value)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), name, fid, value);
}

@@ -1157,6 +1208,9 @@ avismsgPayload_updateOpaque (msgPayload
msg,
const void* value,
mama_size_t size)
{
+ CHECK_PAYLOAD(msg);
+ CHECK_NAME(name,fid);
+ CHECK_NULL (value);
return avisMsg_setOpaque(avisPayload(msg), name, fid, value, size);
}

@@ -1534,6 +1588,7 @@ avismsgPayload_getString (const msgPayload
msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (result);
return avisMsg_getString(avisPayload(msg), name, fid, result);
}

@@ -1546,6 +1601,7 @@ avismsgPayload_getOpaque (const msgPayload
msg,
{
CHECK_PAYLOAD(msg);
CHECK_NAME(name,fid);
+ CHECK_NULL (result);
return avisMsg_getOpaque(avisPayload(msg), name, fid, result, size);
}

@@ -1561,6 +1617,7 @@ avismsgPayload_getField (const msgPayload
msg,
Value* pValue = NULL;
CHECK_PAYLOAD(msg);
CHECK_NAME(name, fid);
+ CHECK_NULL (result);

if ( (!impl->mAvisField) &&
(avismsgFieldPayload_create((msgFieldPayload*) &impl->mAvisField) !=
MAMA_STATUS_OK) ) {
return MAMA_STATUS_PLATFORM;
@@ -1829,6 +1886,7 @@ avismsgPayloadIter_create (msgPayloadIter*
iter,
mama_status status = MAMA_STATUS_OK;
avisIterator* impl = NULL;
CHECK_PAYLOAD(msg);
+ CHECK_NULL (iter);

impl = calloc (1, sizeof (avisIterator));
if (!impl) return (MAMA_STATUS_NOMEM);
@@ -1846,6 +1904,13 @@ avismsgPayloadIter_create (msgPayloadIter*
iter,
return status;
}

+ if (!impl->mAvisMsg)
+ {
+ status = avismsgPayloadIter_associate(impl, msg);
+ if (status != MAMA_STATUS_OK)
+ return status;
+ }
+
*iter = (msgPayloadIter) impl;
return (status);
}
@@ -1861,6 +1926,11 @@ avismsgPayloadIter_get (msgPayloadIter
iter,
avisField(field)->mName = attributes_iter_name(impl->mMsgIterator);
avisField(field)->mValue = attributes_iter_value(impl->mMsgIterator);

+ if (!avisField(field)->mName)
+ {
+ return NULL;
+ }
+
if ((strcmp(SUBJECT_FIELD_NAME, avisField(field)->mName) == 0) ||
(strcmp(INBOX_FIELD_NAME, avisField(field)->mName)== 0))
return (avismsgPayloadIter_next(iter,field,msg));
@@ -1918,7 +1988,7 @@ avismsgPayloadIter_associate (msgPayloadIter
iter,
avisIterator* impl = (avisIterator*) iter;
CHECK_PAYLOAD(msg);

- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

attributes_iter_init(impl->mMsgIterator, avisPayload(msg));
impl->mAvisMsg = avisPayload(msg);
@@ -1929,7 +1999,7 @@ mama_status
avismsgPayloadIter_destroy (msgPayloadIter iter)
{
avisIterator* impl = (avisIterator*) iter;
- if (!impl) return MAMA_STATUS_NULL_ARG;
+ CHECK_NULL (impl);

if (impl->mMsgIterator)
attributes_iter_destroy(impl->mMsgIterator);
@@ -2088,6 +2158,8 @@ avismsgFieldPayload_updateBool (msgFieldPayload
field,
msgPayload msg,
mama_bool_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setBool(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2096,6 +2168,8 @@ avismsgFieldPayload_updateChar (msgFieldPayload
field,
msgPayload msg,
char value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setChar(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2104,6 +2178,8 @@ avismsgFieldPayload_updateU8 (msgFieldPayload
field,
msgPayload msg,
mama_u8_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU8(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2112,6 +2188,8 @@ avismsgFieldPayload_updateI8 (msgFieldPayload
field,
msgPayload msg,
mama_i8_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI8(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2120,6 +2198,8 @@ avismsgFieldPayload_updateI16 (msgFieldPayload
field,
msgPayload msg,
mama_i16_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI16(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2128,6 +2208,8 @@ avismsgFieldPayload_updateU16 (msgFieldPayload
field,
msgPayload msg,
mama_u16_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU16(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2136,6 +2218,8 @@ avismsgFieldPayload_updateI32 (msgFieldPayload
field,
msgPayload msg,
mama_i32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI32(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2144,6 +2228,8 @@ avismsgFieldPayload_updateU32 (msgFieldPayload
field,
msgPayload msg,
mama_u32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU32(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2152,6 +2238,8 @@ avismsgFieldPayload_updateI64 (msgFieldPayload
field,
msgPayload msg,
mama_i64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setI64(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2160,6 +2248,8 @@ avismsgFieldPayload_updateU64 (msgFieldPayload
field,
msgPayload msg,
mama_u64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setU64(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2168,6 +2258,8 @@ avismsgFieldPayload_updateF32 (msgFieldPayload
field,
msgPayload msg,
mama_f32_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setF32(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2176,6 +2268,8 @@ avismsgFieldPayload_updateF64 (msgFieldPayload
field,
msgPayload msg,
mama_f64_t value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setF64(avisPayload(msg), avisField(field)->mName, 0,
value);
}

@@ -2185,6 +2279,8 @@ avismsgFieldPayload_updateDateTime
msgPayload msg,
const mamaDateTime value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setDateTime(avisPayload(msg),
avisField(field)->mName, 0, value);
}

@@ -2193,6 +2289,8 @@ avismsgFieldPayload_updatePrice (msgFieldPayload
field,
msgPayload msg,
const mamaPrice value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
return avisMsg_setPrice(avisPayload(msg), avisField(field)->mName,
0, value);
}

@@ -2201,6 +2299,9 @@ avismsgFieldPayload_updateString (msgFieldPayload
field,
msgPayload msg,
const char* value)
{
+ CHECK_FIELD(field);
+ CHECK_PAYLOAD(msg);
+ CHECK_NULL (value);
return avisMsg_setString(avisPayload(msg), avisField(field)->mName,
0, value);
}

@@ -2211,6 +2312,7 @@ mama_status
avismsgFieldPayload_getBool (const msgFieldPayload field,
mama_bool_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getBool(avisField(field)->mValue, result);
}

@@ -2218,6 +2320,7 @@ mama_status
avismsgFieldPayload_getChar (const msgFieldPayload field,
char* result)
{
+ CHECK_FIELD(field);
return avisValue_getChar(avisField(field)->mValue, result);
}

@@ -2225,6 +2328,7 @@ mama_status
avismsgFieldPayload_getI8 (const msgFieldPayload field,
mama_i8_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI8(avisField(field)->mValue, result);
}

@@ -2232,6 +2336,7 @@ mama_status
avismsgFieldPayload_getU8 (const msgFieldPayload field,
mama_u8_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU8(avisField(field)->mValue, result);
}

@@ -2239,6 +2344,7 @@ mama_status
avismsgFieldPayload_getI16 (const msgFieldPayload field,
mama_i16_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI16(avisField(field)->mValue, result);
}

@@ -2246,6 +2352,7 @@ mama_status
avismsgFieldPayload_getU16 (const msgFieldPayload field,
mama_u16_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU16(avisField(field)->mValue, result);
}

@@ -2253,6 +2360,7 @@ mama_status
avismsgFieldPayload_getI32 (const msgFieldPayload field,
mama_i32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI32(avisField(field)->mValue, result);
}

@@ -2260,6 +2368,7 @@ mama_status
avismsgFieldPayload_getU32 (const msgFieldPayload field,
mama_u32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU32(avisField(field)->mValue, result);
}

@@ -2267,6 +2376,7 @@ mama_status
avismsgFieldPayload_getI64 (const msgFieldPayload field,
mama_i64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getI64(avisField(field)->mValue, result);
}

@@ -2274,6 +2384,7 @@ mama_status
avismsgFieldPayload_getU64 (const msgFieldPayload field,
mama_u64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getU64(avisField(field)->mValue, result);
}

@@ -2281,6 +2392,7 @@ mama_status
avismsgFieldPayload_getF32 (const msgFieldPayload field,
mama_f32_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getF32(avisField(field)->mValue, result);
}

@@ -2288,6 +2400,7 @@ mama_status
avismsgFieldPayload_getF64 (const msgFieldPayload field,
mama_f64_t* result)
{
+ CHECK_FIELD(field);
return avisValue_getF64(avisField(field)->mValue, result);
}

@@ -2295,6 +2408,8 @@ mama_status
avismsgFieldPayload_getString (const msgFieldPayload field,
const char** result)
{
+ CHECK_FIELD(field);
+ CHECK_NULL (result);
return avisValue_getString(avisField(field)->mValue, result);
}

@@ -2303,6 +2418,9 @@ avismsgFieldPayload_getOpaque (const
msgFieldPayload field,
const void** result,
mama_size_t* size)
{
+ CHECK_FIELD(field);
+ CHECK_NULL (result);
+ CHECK_NULL (size);
return avisValue_getOpaque(avisField(field)->mValue, result, size);
}

@@ -2310,6 +2428,7 @@ mama_status
avismsgFieldPayload_getDateTime (const msgFieldPayload field,
mamaDateTime result)
{
+ CHECK_FIELD(field);
return avisValue_getDateTime(avisField(field)->mValue, result);
}

@@ -2317,6 +2436,7 @@ mama_status
avismsgFieldPayload_getPrice (const msgFieldPayload field,
mamaPrice result)
{
+ CHECK_FIELD(field);
return avisValue_getPrice(avisField(field)->mValue, result);
}

@@ -2324,6 +2444,7 @@ mama_status
avismsgFieldPayload_getMsg (const msgFieldPayload field,
msgPayload* result)
{
+ CHECK_FIELD(field);
return MAMA_STATUS_NOT_IMPLEMENTED;
}

--
1.9.0
________________________________________________________

This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.
________________________________________________________


Damian Maguire <DMaguire@...>
 

Cheers Lee, that patch looks good and seems to make the payload tests a bit more stable. Patch merged into the next branch, commit ID: 074ef098304166d6ea8fe3bb9b212030fcc08775

D

Damian Maguire – Senior R&D and OpenMAMA Specialist
IntercontinentalExchange | NYSE Technologies
24-26 Adelaide Exchange | Belfast, BT2 8GD
Tel: +44 2890 822 282 (ext: 452161) | Mob: +44 7540 204 077

From: Lee Skillen <lskillen@...>
Date: Monday, March 10, 2014 2:07 PM
To: "openmama-dev@..." <openmama-dev@...>
Subject: [Openmama-dev] [PATCH] AVIS: Align avis payload with payload tests (fix core dumps).

Avis core dumps under the existing payload unit tests due to lacking NULL and
invalid argument checks - Fix these so it runs cleanly (still fails aspects but
that's preferable to coring).

Signed-off-by: Lee Skillen <lskillen@...>
---
 mama/c_cpp/src/c/payload/avismsg/avispayload.c | 135 +++++++++++++++++++++++--
 1 file changed, 128 insertions(+), 7 deletions(-)

diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.c b/mama/c_cpp/src/c/payload/avismsg/avispayload.c
index

This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.