Check for matching data size when reading Sdo entries via sysfs.
--- a/master/sdo_entry.c Mon Jun 02 14:40:19 2008 +0000
+++ b/master/sdo_entry.c Tue Jun 03 12:04:00 2008 +0000
@@ -185,6 +185,15 @@
off_t off = 0;
unsigned int i;
+ if (request->data_size != entry->bit_length) {
+ EC_ERR("Dictionary size of Sdo entry 0x%04X:%02X (%u bit) does not "
+ "match size of uploaded data (%u byte)!\n", entry->sdo->index,
+ entry->subindex, entry->bit_length, request->data_size);
+ EC_DBG("Uploaded data:\n");
+ ec_print_data(request->data, request->data_size);
+ return -EIO;
+ }
+
if (entry->data_type == 0x0002) { // int8
int8_t value;
if (entry->bit_length != 8)