mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Fix possible dereference in fpi_ssm_next_state()
libfprint/fpi-ssm.c:244:9: warning: Access to field 'completed' results in a dereference of a null pointer (loaded from variable 'machine')
BUG_ON(machine->completed);
^~~~~~~~~~~~~~~~~~
libfprint/fpi-log.h:84:6: note: expanded from macro 'BUG_ON'
if (condition) { \
^~~~~~~~~
This commit is contained in:
@@ -241,6 +241,8 @@ void fpi_ssm_mark_failed(fpi_ssm *machine, int error)
|
||||
*/
|
||||
void fpi_ssm_next_state(fpi_ssm *machine)
|
||||
{
|
||||
g_return_if_fail (machine != NULL);
|
||||
|
||||
BUG_ON(machine->completed);
|
||||
machine->cur_state++;
|
||||
if (machine->cur_state == machine->nr_states) {
|
||||
|
||||
Reference in New Issue
Block a user