nuttx-apps/system/nxrecorder
wangjianyu3 6a1b2c6903 system/nxrecorder: Fix null pointer dereference in argument parsing
When a command has no arguments (e.g., 'q', 'quit', 'stop'), the strtok_r()
function returns NULL for the arg parameter. The argument trimming loop was
dereferencing this NULL pointer without checking, causing undefined behavior
and system hang on ESP32-S3.

This commit adds a null check before dereferencing the arg pointer in the
leading space trimming loop.

Tested on ESP32-S3 (lckfb-szpi-esp32s3) - quit command now works correctly.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-26 10:42:48 +01:00
..
CMakeLists.txt system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Kconfig nxrecorder: add support to record media file. 2023-02-02 22:12:00 +08:00
Make.defs system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
nxrecorder.c system: unify Private Types banners 2025-05-28 10:16:50 +08:00
nxrecorder_amr.c system: unify Private Types banners 2025-05-28 10:16:50 +08:00
nxrecorder_common.c system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
nxrecorder_main.c system/nxrecorder: Fix null pointer dereference in argument parsing 2026-03-26 10:42:48 +01:00