diff options
Diffstat (limited to 'contrib/opie/libopie/challenge.c')
-rw-r--r-- | contrib/opie/libopie/challenge.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/opie/libopie/challenge.c b/contrib/opie/libopie/challenge.c index fc836aa..6c42018 100644 --- a/contrib/opie/libopie/challenge.c +++ b/contrib/opie/libopie/challenge.c @@ -68,7 +68,9 @@ int opiechallenge FUNCTION((mp, name, ss), struct opie *mp AND char *name AND ch } if (rval || - (snprintf(ss, OPIE_CHALLENGE_MAX, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX)) { + (snprintf(ss, OPIE_CHALLENGE_MAX+1, "otp-%s %d %s ext", algids[MDX], mp->opie_n - 1, mp->opie_seed) >= OPIE_CHALLENGE_MAX+1)) { + if (!rval) + rval = 1; opierandomchallenge(ss); memset(mp, 0, sizeof(*mp)); } |