diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2024-01-04 19:18:34 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-01-04 18:18:34 +0000 |
commit | f19cd01ad56306e05145ff51fa392163405b8516 (patch) | |
tree | 5739d0f81cf93f8b91a6fd7e21ea884d74376f00 /libpam/pam_private.h | |
parent | 3c71b368dd52e6acd2e887a8b8317a223b3fce4e (diff) | |
download | pam-f19cd01ad56306e05145ff51fa392163405b8516.tar.gz pam-f19cd01ad56306e05145ff51fa392163405b8516.tar.bz2 pam-f19cd01ad56306e05145ff51fa392163405b8516.zip |
libpam: enclose function macros
Avoid potential dangling-else issues by wrapping macros inside a while
loop.
Diffstat (limited to 'libpam/pam_private.h')
-rw-r--r-- | libpam/pam_private.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libpam/pam_private.h b/libpam/pam_private.h index df6872fa..f9dd6223 100644 --- a/libpam/pam_private.h +++ b/libpam/pam_private.h @@ -289,10 +289,12 @@ void _pam_parse_control(int *control_array, char *tok); */ #define IF_NO_PAMH(pamh,ERR) \ -if ((pamh) == NULL) { \ - syslog(LOG_ERR, _PAM_SYSTEM_LOG_PREFIX " %s: NULL pam handle passed", __FUNCTION__); \ - return ERR; \ -} +do { \ + if ((pamh) == NULL) { \ + syslog(LOG_ERR, _PAM_SYSTEM_LOG_PREFIX " %s: NULL pam handle passed", __FUNCTION__); \ + return ERR; \ + } \ +} while(0) /* * include some helpful macros |