pam_cifscreds: fix warning on NULL arg passed to %s in pam_syslog()
Subsystems (2)
PATCH 1/1 pam_cifscreds: fix warning on NULL arg passed to %s in pam_syslog()
Fix the following compiler warning with -Wformat-overflow in cifscreds_pam_update():
pam_cifscreds.c: In function ‘cifscreds_pam_update’:
pam_cifscreds.c:340:83: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
340 | pam_syslog(ph, LOG_ERR, "error: Update credential key for %s: %s",
| ^~
Fixes cbbcd6e71c0a ("cifscreds: create PAM module to insert credentials at login")
Signed-off-by Paulo Alcantara (Red Hat) <[email protected]>
--- pam_cifscreds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pam_cifscreds.c +1 -1
@@ -338,7 +338,7 @@ static int cifscreds_pam_update(pam_handle_t *ph, const char *user, const char *key_serial_t key =key_add (currentaddress, user, password, keytype);if (key <=0 ) {pam_syslog (ph,LOG_ERR ,"error: Update credential key for %s: %s" , - currentaddress,strerror (errno)); + (currentaddress ?:"(null)" ),strerror (errno)); } }
Signature · 1 line
2.44.0