浏览代码

HPCC-22181 Mismatched size table in hidl

Picked up by sanitize checks, because was reading off the end of the table
when kind was ESP_ENUM.

No idea what it any impact it had in reality.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 年之前
父节点
当前提交
7dc1281d0f
共有 1 个文件被更改,包括 20 次插入19 次删除
  1. 20 19
      tools/hidl/hidlcomp.cpp

+ 20 - 19
tools/hidl/hidlcomp.cpp

@@ -135,25 +135,26 @@ const char *clarion_type_name[] =
 
 const int type_size[] = 
 {
-    1,
-    1,
-    1,
-    1,
-    0,  // pretend we don't know (To be fixed at some later date)
-    2,
-    2,
-    4,
-    4,
-    4,
-    4,
-    8,
-    8,
-    8,
-    4, // STRUCT
-    4, // ENUM
-    0, // void
-    1, // ESP_STRUCT
-    1  // ESP_ENUM
+    0,  // tk_null
+    1,  // TK_CHAR
+    1,  // TK_UCHAR
+    1,  // BYTE
+    1,  // BOOL
+    2,  // SHORT
+    2,  // USHORT
+    4,  // INT
+    4,  // UNSIGNED
+    4,  // LONG
+    4,  // ULONG
+    8,  // LONGLONG
+    8,  // ULONGLONG
+    8,  // DOUBLE
+    4,  // FLOAT
+    4,  // STRUCT
+    4,  // ENUM
+    0,  // void
+    1,  // ESP_STRUCT
+    1   // ESP_ENUM
 };
 
 static const char *xlattable[] =