Comments (1)
Thanks very much for reporting this issue. I changed it to below in our internal repository and plan to publish this in next release. Please let me know if this is OK or not in your transplant
diff --git a/src/packages/LITE-utils/json_parser.c b/src/packages/LITE-utils/json_parser.c
index cb09af7..d58bdcb 100644
--- a/src/packages/LITE-utils/json_parser.c
+++ b/src/packages/LITE-utils/json_parser.c
@@ -183,6 +183,8 @@ int json_parse_name_value(char *p_cJsonStr, int iStrLen, json_parse_cb pfnCB, vo
int json_get_value_by_name_cb(char *p_cName, int iNameLen, char *p_cValue, int iValueLen, int iValueType,
void *p_CBData)
{
+ JSON_NV *p_stNameValue = (JSON_NV *)p_CBData;
+
#if (JSON_DEBUG == 1)
int i;
@@ -201,8 +203,6 @@ int json_get_value_by_name_cb(char *p_cName, int iNameLen, char *p_cValue, int i
}
#endif
- JSON_NV *p_stNameValue = (JSON_NV *)p_CBData;
-
if (!strncmp(p_cName, p_stNameValue->pN, p_stNameValue->nLen)) {
p_stNameValue->pV = p_cValue;
p_stNameValue->vLen = iValueLen;
@@ -215,8 +215,9 @@ int json_get_value_by_name_cb(char *p_cName, int iNameLen, char *p_cValue, int i
char *json_get_value_by_name(char *p_cJsonStr, int iStrLen, char *p_cName, int *p_iValueLen, int *p_iValueType)
{
- JSON_NV stNV = { 0, 0, 0, 0 };
+ JSON_NV stNV;
+ memset(&stNV, 0, sizeof(stNV));
stNV.pN = p_cName;
stNV.nLen = strlen(p_cName);
if (JSON_RESULT_OK == json_parse_name_value(p_cJsonStr, iStrLen, json_get_value_by_name_cb, (void *)&stNV)) {
Your feedback is highly appreciated and welcome :)
from iotkit-embedded.
Related Issues (20)
- HAL_Sys_Net_Is_Ready() HAL API is not needed when only dev_bind is included
- make menuconfig的问题
- 局域网无法控制设备 HOT 1
- 建议在所有的 Kconfig 配置前增加前缀以区别于其他的软件
- iotx_dm_internal.h:70 没有对 server 使用宏包裹 HOT 3
- Typo in _iotx_alcs_adapter_subdev_list_destroy cause abort signal HOT 1
- 在CoAPMessage_process里面,可能导致线程没办法退出
- V3.0.1 SDK可能出现随机的消息丢失情况 HOT 1
- 请问天猫精灵怎么用这个接入呢
- APP上删除子设备后,网关是否能得到通知
- 您好,目前有没有golang版本的SDK?
- awss_statis.h 文件中 #define AWSS_REPORT_STATIS(m) awss_disp_statis(m) 是否写错? HOT 1
- 关于HAL_KV_linux.c里面的hash 大小
- cmake出错Target "iot_hal" of type OBJECT_LIBRARY may not be linked into another target
- src/dev_model/examples/linkkit_example_gateway.c问题
- keil编译部分头文件报newline warning
- [http] Memory leak with wrapper_http_deinit(...) call
- [咨询] SDK 何时支持蓝牙配网
- c-sdk支持TLS 1.3吗
- Windows上HAL的实现
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotkit-embedded.