Jelajahi Sumber

#IQRV #comment: 模拟崩溃问题调试1

陈纪林80310970 8 bulan lalu
induk
melakukan
7093089dc1

+ 3 - 2
DevAdapter/simulator/deps/libSimulaRestful/JsonConvertHelper.hpp

@@ -276,8 +276,9 @@ static bool Json2Object(ByteData& aimObj, const Json::Value& jsonTypeValue)
         return false;
     }
     else {
-        StrBuf2HexBuf(jsonTypeValue.asString().c_str(), &tmp);
-        memcpy(aimObj.bData, tmp, 4096);
+        memset(aimObj.bData, 0, 4096);
+        int len = StrBuf2HexBuf(jsonTypeValue.asString().c_str(), &tmp);
+        memcpy(aimObj.bData, tmp, len);
         delete[] tmp;
         return true;
     }