Index: TestSupport.c =================================================================== diff -u -r98fa971c534d21b71371cb72a7c0839fe79045e6 -r36df97071f4a8ba7a2bbfe129db7c7b231d293d8 --- TestSupport.c (.../TestSupport.c) (revision 98fa971c534d21b71371cb72a7c0839fe79045e6) +++ TestSupport.c (.../TestSupport.c) (revision 36df97071f4a8ba7a2bbfe129db7c7b231d293d8) @@ -591,7 +591,7 @@ BOOL result = FALSE; MESSAGE_T msg; TEST_CONFIG_T config; - U32 configStatus = 0; + BOOL configStatus; U08 *payloadPtr = msg.payload; if ( TRUE == isTestingActivated() ) @@ -607,14 +607,21 @@ #ifdef _RO_ //msg.hdr.msgID = //TODO update; #endif - msg.hdr.payloadLen = sizeof( testConfig ); + msg.hdr.payloadLen = MIN( sizeof( testConfig ), ( sizeof( BOOL ) * MAX_TEST_CONFIGS ) ); for ( config = TEST_CONFIG_FIRST; config < NUM_OF_TEST_CONFIGS; ++config ) { - configStatus = (U32)getTestConfigStatus( config ); + configStatus = getTestConfigStatus( config ); - memcpy( payloadPtr, &configStatus, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); + if ( (U32)config >= MAX_TEST_CONFIGS ) + { + break; + } + else + { + memcpy( payloadPtr, (U08*)&configStatus, sizeof( BOOL ) ); + payloadPtr += sizeof( BOOL ); + } } // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer