From 1e229bb514f932b9ee37027b7d815d9f5a50287d Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Sun, 22 Jul 2007 15:22:54 +0000 Subject: [PATCH] Check the return of the conf initialization --- pam_usb/src/pam.c | 3 ++- pam_usb/src/pamusb-check.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pam_usb/src/pam.c b/pam_usb/src/pam.c index ada4e3e..8e2641d 100644 --- a/pam_usb/src/pam.c +++ b/pam_usb/src/pam.c @@ -53,7 +53,8 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, if (argc > 1) if (!strcmp(argv[0], "-c")) conf_file = (char *)argv[1]; - pusb_conf_init(&opts); + if (!pusb_conf_init(&opts)) + return (PAM_AUTH_ERR); if (!pusb_conf_parse(conf_file, &opts, user, service)) return (PAM_AUTH_ERR); diff --git a/pam_usb/src/pamusb-check.c b/pam_usb/src/pamusb-check.c index b8b8e0b..30a449b 100644 --- a/pam_usb/src/pamusb-check.c +++ b/pam_usb/src/pamusb-check.c @@ -123,7 +123,8 @@ int main(int argc, char **argv) pusb_check_usage(argv[0]); return (1); } - pusb_conf_init(&opts); + if (!pusb_conf_init(&opts)) + return (1); if (!pusb_conf_parse(conf_file, &opts, user, service)) return (1); if (quiet)