Explorar o código

fix: mobile,l_mobile_get_band的total_num,应该初始化为0,避免底层获取失败后, 客户没有判断返回值,直接zbuff->used的值,一个未知值

Wendal Chen hai 2 meses
pai
achega
2b53b71152
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      components/mobile/luat_lib_mobile.c

+ 1 - 1
components/mobile/luat_lib_mobile.c

@@ -987,7 +987,7 @@ end
  */
  */
 static int l_mobile_get_band(lua_State* L) {
 static int l_mobile_get_band(lua_State* L) {
     luat_zbuff_t *buff = ((luat_zbuff_t *)luaL_checkudata(L, 1, LUAT_ZBUFF_TYPE));
     luat_zbuff_t *buff = ((luat_zbuff_t *)luaL_checkudata(L, 1, LUAT_ZBUFF_TYPE));
-    uint8_t total_num;
+    uint8_t total_num = 0;
     int re;
     int re;
     if (buff->len < 40)
     if (buff->len < 40)
     {
     {