]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Followup to r14908 (BZ #342603).
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 20 Sep 2015 13:40:47 +0000 (13:40 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 20 Sep 2015 13:40:47 +0000 (13:40 +0000)
The first byte of the data array holds the length, so the actual data
length is the value of that byte plus one.
Patch by Jean Delvare <jdelvare@suse.de>.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15655

coregrind/m_syswrap/syswrap-linux.c

index 980f881b1ba2e703455254d979df255e22d4c1d7..4b43e90a5199e47d4c2a75b995ee8df0fb783033 100644 (file)
@@ -6884,7 +6884,7 @@ PRE(sys_ioctl)
                         case VKI_I2C_SMBUS_I2C_BLOCK_BROKEN:
                         case VKI_I2C_SMBUS_BLOCK_PROC_CALL:
                         case VKI_I2C_SMBUS_I2C_BLOCK_DATA:
-                            size = vkis->data->block[0];
+                            size = 1 + vkis->data->block[0];
                             break;
                         default:
                             size = 0;
@@ -9410,7 +9410,7 @@ POST(sys_ioctl)
                         case VKI_I2C_SMBUS_I2C_BLOCK_BROKEN:
                         case VKI_I2C_SMBUS_BLOCK_PROC_CALL:
                         case VKI_I2C_SMBUS_I2C_BLOCK_DATA:
-                            size = vkis->data->block[0];
+                            size = 1 + vkis->data->block[0];
                             break;
                         default:
                             size = 0;