Skip to content

Commit 9a6d025

Browse files
authored
Address a lint warning in PAM / NSS about regcomp return value check (#309)
Address a lint warning in PAM / NSS that regcomp int return value is used as bool. Non-zero value means error according to `man regcomp`.
2 parents 4cd17ba + 544c4e8 commit 9a6d025

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mig/src/include/auth/migauth.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ static int validate_username(const char *username)
416416
}
417417

418418
regex_res = regcomp(&validator, username_regex, REG_EXTENDED | REG_NOSUB);
419-
if (regex_res) {
419+
if (regex_res != 0) {
420+
/* Failure in regex compilation */
420421
if (regex_res == REG_ESPACE) {
421422
WRITELOGMESSAGE(LOG_ERR,
422423
"Memory error in username validation: %s\n",

0 commit comments

Comments
 (0)