mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-05-06 04:28:29 +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:
parent
34f24cbe19
commit
944493e472
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue