diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-03-23 19:54:00 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-03-23 19:54:00 +0100 |
commit | d1963687081754796ab643569a882ba6636a44c6 (patch) | |
tree | d0396fa3b6aa46ba8b1835a956905a7196f8c645 /modules/pam_selinux | |
parent | fbc66d1cdbbb4bd3abd98b84b51be05f4b061d95 (diff) | |
download | pam-d1963687081754796ab643569a882ba6636a44c6.tar.gz pam-d1963687081754796ab643569a882ba6636a44c6.tar.bz2 pam-d1963687081754796ab643569a882ba6636a44c6.zip |
pam_selinux: sanitize asprintf argument on failure
Diffstat (limited to 'modules/pam_selinux')
-rw-r--r-- | modules/pam_selinux/pam_selinux.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/pam_selinux/pam_selinux.c b/modules/pam_selinux/pam_selinux.c index 57b02bac..5b7dd277 100644 --- a/modules/pam_selinux/pam_selinux.c +++ b/modules/pam_selinux/pam_selinux.c @@ -103,6 +103,7 @@ send_audit_message(pam_handle_t *pamh, int success, const char *default_context, if (asprintf(&msg, "pam: default-context=%s selected-context=%s", default_raw ? default_raw : (default_context ? default_context : "?"), selected_raw ? selected_raw : (selected_context ? selected_context : "?")) < 0) { + msg = NULL; /* asprintf leaves msg in undefined state on failure */ pam_syslog(pamh, LOG_ERR, "Error allocating memory."); goto out; } |