diff options
author | Benjamin Berg <bberg@redhat.com> | 2020-12-05 11:36:41 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2020-12-07 15:27:14 +0100 |
commit | 043fcaafec655d9956cd73db2184637a25aa093b (patch) | |
tree | fce20a95c055aee6cc2b4fef155f558f421db35c | |
parent | bf2236620e808cb69b449da2ce0319bddace9218 (diff) |
pam_fprintd: Guard against NULL pointer returned by finger_str_to_msg
Otherwise the PAM module will crash trying to send an info message about
the selected print.
-rw-r--r-- | pam/pam_fprintd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c index 583e7c5..bd156ce 100644 --- a/pam/pam_fprintd.c +++ b/pam/pam_fprintd.c @@ -249,6 +249,10 @@ verify_finger_selected (sd_bus_message *m, } msg = finger_str_to_msg(finger_name, data->driver, data->is_swipe); + if (!msg) { + data->result = strdup ("Protocol error with fprintd!"); + return 0; + } if (debug) pam_syslog (data->pamh, LOG_DEBUG, "verify_finger_selected %s", msg); send_info_msg (data->pamh, msg); |