Fix null pointer access issue when check audio_id 84/284584/4 accepted/tizen/unified/20221123.015014
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 21 Nov 2022 08:49:55 +0000 (17:49 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 21 Nov 2022 10:19:17 +0000 (19:19 +0900)
commit493ec7a4362b29681344c69c156680e95802ab2b
tree13c898b883950c7370d3cbac48ddfb3373f06acc
parent5abb09628c82ea06e8b4000c413b41fb57a71e1d
Fix null pointer access issue when check audio_id

- Issue:
The first time to start recording, the engine can get null audio_id from
stt engine module, if the engine app did not set audio id.

- Solution:
Because of the order of calling setter and getter of audio id, getter
can provide null pointer as audio id, but the implementation does not
check it. Thus, this patch adds null pointer checker and fix some logic
to prevent crash by accessing null pointer.

Change-Id: Id68f17f6267adf3bffadd07ad797978b4800045b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
common/stt_defs.h
common/stt_engine.c
server/sttd_engine_agent.c
server/sttd_recorder.c