2023.09.14

CVE-2022-20224 A-220732646 ID High 10, 11, 12, 12L

patch

分析

也很容易根据patch看出来,while循环中遍历buf的时候,只判断了是否遇到回车符\r,而没有判断终止符\0,可导致越界读。

/* skip rest of AT string up to <cr> */
#define AT_SKIP_REST(buf)           \
  do {                              \
    while (*(buf) != '\r') (buf)++; \  // 没有判断\0,可导致越界读
  } while (0)