diff options
author | Dan Carpenter <error27@gmail.com> | 2011-07-27 07:11:43 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-27 16:28:16 -0400 |
commit | 8f50c7f5d63b0e4a29f6f96e8cfaca782e0c458d (patch) | |
tree | bc2f8064a1170be3755b4443f813ee50bf85e3fd /drivers/target | |
parent | 4a28a3fa8c37193b105807193b3695048f0050a4 (diff) |
iscsi-target: strlen() doesn't count the terminator
This patch fixes an off by one check in iscsit_add_tiqn() because the
NULL terminator isn't taken into consideration.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 14c81c4265bd..396c79d8569c 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -120,7 +120,7 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf) | |||
120 | struct iscsi_tiqn *tiqn = NULL; | 120 | struct iscsi_tiqn *tiqn = NULL; |
121 | int ret; | 121 | int ret; |
122 | 122 | ||
123 | if (strlen(buf) > ISCSI_IQN_LEN) { | 123 | if (strlen(buf) >= ISCSI_IQN_LEN) { |
124 | pr_err("Target IQN exceeds %d bytes\n", | 124 | pr_err("Target IQN exceeds %d bytes\n", |
125 | ISCSI_IQN_LEN); | 125 | ISCSI_IQN_LEN); |
126 | return ERR_PTR(-EINVAL); | 126 | return ERR_PTR(-EINVAL); |