Explorar el Código

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

Wendal Chen hace 2 meses
padre
commit
2b53b71152
Se han modificado 1 ficheros con 1 adiciones y 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) {
     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;
     if (buff->len < 40)
     {