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:
parent
310b5ee125
commit
9ff1a454ce
|
@ -55,9 +55,9 @@ oath_key_create(const char *label,
|
||||||
struct oath_key *key;
|
struct oath_key *key;
|
||||||
int labellen;
|
int labellen;
|
||||||
|
|
||||||
/* check label */
|
/* check label length */
|
||||||
if (label == NULL ||
|
if (label == NULL ||
|
||||||
(labellen = strlen(label)) > OATH_MAX_LABELLEN)
|
(labellen = strlen(label)) >= OATH_MAX_LABELLEN)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
/* check key length */
|
/* check key length */
|
||||||
|
|
Loading…
Reference in New Issue