btmon: fix segfault caused by integer underflow
authorMatias Karhumaa <matias.karhumaa@gmail.com>
Tue, 16 Oct 2018 20:22:42 +0000 (23:22 +0300)
committerhimanshu <h.himanshu@samsung.com>
Tue, 14 Jan 2020 08:53:35 +0000 (14:23 +0530)
commit1be5ac4f343645046433598911dfa307b55f8c22
tree6128f58b87b5ca638c566a0d4e3dce82f499419b
parent9c547adfffc308969459d6096ae0b2e26a62eb64
btmon: fix segfault caused by integer underflow

Fix segfault caused by integer underflow in set_event_filter_cmd().
Fix is to check that size is big enough before subtracting to prevent
underflow.

Crash was found by fuzzing btmon with AFL.

Change-Id: I2e8c45af686bc86beb20221118240958afa58426
Signed-off-by: himanshu <h.himanshu@samsung.com>
monitor/packet.c