summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2011-06-02 21:57:31 +0200
committerTomas Mraz <tmraz@fedoraproject.org>2011-06-02 21:57:31 +0200
commit3475dbeb44238b5b8910cea4abfde106c6e90618 (patch)
tree78e037d45dac2a99f414d4e94dedeb4bdb1fa7d2
parent26747b9b490d190dd20543ea9cbde082ae667402 (diff)
Check for return value of pam_get_item() in pam_echo module.
-rw-r--r--ChangeLog3
-rw-r--r--modules/pam_echo/pam_echo.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 90bb7c06..a7c485cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)