mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
pam_fprintd: Protect usage of strdup for NULL values
It's not smart as g_strdup, so need to ensure we don't use it for NULL
strings.
This is a regression caused by commit bf223662
This commit is contained in:
@ -155,7 +155,7 @@ open_device (pam_handle_t *pamh,
|
||||
|
||||
sd_bus_message_exit_container (m);
|
||||
|
||||
return strdup (path);
|
||||
return path ? strdup (path) : NULL;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
@ -226,7 +226,7 @@ verify_result (sd_bus_message *m,
|
||||
data->result = NULL;
|
||||
}
|
||||
|
||||
if (done)
|
||||
if (done && result)
|
||||
{
|
||||
data->result = strdup (result);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user