Changed getReadResultNetworkDict behaviour about size. Do not copy more data than pointet by Size arg.
--- a/src/sdo.c Tue Jul 08 15:14:48 2008 +0200
+++ b/src/sdo.c Wed Jul 16 15:21:04 2008 +0200
@@ -1509,15 +1509,15 @@
}
/*!
-**
-**
-** @param d
-** @param nodeId
-** @param data
-** @param size
-** @param abortCode
-**
-** @return
+**
+**
+** @param d
+** @param nodeId
+** @param data
+** @param size pointer to expected size, changed into returned size. Expected size will be truncated to transfered data size
+** @param abortCode
+**
+** @return
**/
UNS8 getReadResultNetworkDict (CO_Data* d, UNS8 nodeId, void* data, UNS8 *size,
UNS32 * abortCode)
@@ -1537,7 +1537,9 @@
return d->transfers[line].state;
/* Transfert is finished. Put the value in the data. */
- * size = (UNS8)d->transfers[line].count;
+ /* use transfers[line].count as max size */
+ if( (UNS8)d->transfers[line].count < *size )
+ *size = (UNS8)d->transfers[line].count;
for ( i = 0 ; i < *size ; i++) {
# ifdef CANOPEN_BIG_ENDIAN
if (d->transfers[line].dataType != visible_string)