sim/wifidriver: Fix the scan error.

Using the uninitialized buffer causes the out of bounds.
Add a terminator for the rbuf.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
liqinhui 2023-10-16 16:55:05 +08:00 committed by Xiang Xiao
parent fc80c70205
commit 66b11d8940

View File

@ -594,6 +594,10 @@ get_scan:
goto get_scan; goto get_scan;
} }
/* Add a terminator for the rbuf */
rbuf[ret] = '\0';
ret = -EAGAIN; ret = -EAGAIN;
for (p = rbuf; *p != '\0'; p++) for (p = rbuf; *p != '\0'; p++)
{ {