diff options
author | 2002-10-13 21:12:59 +0000 | |
---|---|---|
committer | 2002-10-13 21:12:59 +0000 | |
commit | 7ed757df6ac59590397f053752210a953c329e0f (patch) | |
tree | a8440154d630b774dffdc2a30139ca89669bb98d /lib/libc | |
parent | Avoid potential printf format string problem with challenge from (diff) | |
download | wireguard-openbsd-7ed757df6ac59590397f053752210a953c329e0f.tar.xz wireguard-openbsd-7ed757df6ac59590397f053752210a953c329e0f.zip |
Move the clearing of as->state in auth_challenge() to after the sanity
checks. The check for "as != NULL" is useless if you have already
dereferenced "as". Also fix some comment typos. From Moritz Jodeit.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/auth_subr.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c index 32b1f309fea..24417d3b23f 100644 --- a/lib/libc/gen/auth_subr.c +++ b/lib/libc/gen/auth_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_subr.c,v 1.12 2002/08/04 22:44:12 millert Exp $ */ +/* $OpenBSD: auth_subr.c,v 1.13 2002/10/13 21:12:59 millert Exp $ */ /*- * Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc. @@ -285,11 +285,11 @@ auth_challenge(auth_session_t *as) { char path[MAXPATHLEN]; - as->state = 0; - if (as == NULL || as->style == NULL || as->name == NULL) return (NULL); + as->state = 0; + if (as->challenge) { free(as->challenge); as->challenge = NULL; @@ -748,10 +748,9 @@ auth_check_change(auth_session_t *as) * is AUTH_OKAY for approval like scripts. * * Internally additional trailing arguments can be read from as->ap - * Options will be placed be placed just after the first argument - * (not including path). + * Options will be placed just after the first argument (not including path). * - * Any data will sent (and freed) to the script + * Any data will be sent to (and freed by) the script */ int auth_call(auth_session_t *as, char *path, ...) @@ -764,7 +763,7 @@ auth_call(auth_session_t *as, char *path, ...) int okay; int pfd[2]; int argc; - char *argv[64]; /* 64 args should more than enough */ + char *argv[64]; /* 64 args should be more than enough */ #define Nargc (sizeof(argv)/sizeof(argv[0])) va_start(as->ap0, path); |