diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | modules/pam_echo/pam_echo.c | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -16,6 +16,9 @@ * modules/pam_filter/pam_filter.c (process_args): Guard for error return from pam_get_user(). + * modules/pam_echo/pam_echo.c (replace_and_print): Guard for error return + from pam_get_item(). + 2011-05-30 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_timestamp/pam_timestamp.c (main): Remove unsused diff --git a/modules/pam_echo/pam_echo.c b/modules/pam_echo/pam_echo.c index 31ebca22..043ff703 100644 --- a/modules/pam_echo/pam_echo.c +++ b/modules/pam_echo/pam_echo.c @@ -119,7 +119,10 @@ replace_and_print (pam_handle_t *pamh, const char *mesg) str = &myhostname; } else - pam_get_item (pamh, item, &str); + { + if (pam_get_item (pamh, item, &str) != PAM_SUCCESS) + str = NULL; + } if (str == NULL) str = "(null)"; for (q = str; *q != '\0' && len < length - 1; ++q) |