Fix off-by-one bug: we forgot to account for the terminating NUL when

checking the length of the label.


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@881 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2016-01-09 18:29:32 +00:00
parent 310b5ee125
commit 9ff1a454ce
1 changed files with 2 additions and 2 deletions

View File

@ -55,9 +55,9 @@ oath_key_create(const char *label,
struct oath_key *key;
int labellen;
/* check label */
/* check label length */
if (label == NULL ||
(labellen = strlen(label)) > OATH_MAX_LABELLEN)
(labellen = strlen(label)) >= OATH_MAX_LABELLEN)
return (NULL);
/* check key length */