summaryrefslogtreecommitdiff
path: root/usr/auth.c
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2022-01-25 10:11:58 -0800
committerLee Duncan <lduncan@suse.com>2022-01-25 10:11:58 -0800
commit151e701d08e16dce545d017e57c3d5ac957b7c1e (patch)
treec0c0ab43e4870787c1bcda37ecde576b09e41487 /usr/auth.c
parent66bb7ab93ac4bc9749b20b8f4e6d3e1b82983383 (diff)
downloadopen-iscsi-151e701d08e16dce545d017e57c3d5ac957b7c1e.tar.gz
Fix issues discovered by gcc12
Gcc-12 caught a few errors in the code where we were checking for an array being empty incorrectly, so this commit fixes those.
Diffstat (limited to 'usr/auth.c')
-rw-r--r--usr/auth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr/auth.c b/usr/auth.c
index 2f7506f..46c328e 100644
--- a/usr/auth.c
+++ b/usr/auth.c
@@ -109,7 +109,7 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
unsigned char verify_data[client->chap_challenge_len];
/* the expected credentials are in the session */
- if (session->username_in == NULL) {
+ if (session->username_in[0] == '\0') {
log_error("failing authentication, no incoming username "
"configured to authenticate target %s",
session->target_name);
@@ -122,7 +122,6 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
}
if ((session->password_in_length < 1) ||
- (session->password_in == NULL) ||
(session->password_in[0] == '\0')) {
log_error("failing authentication, no incoming password "
"configured to authenticate target %s",