diff options
author | Toomas Soome <tsoome@me.com> | 2020-09-08 00:05:51 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2020-09-21 20:31:56 +0300 |
commit | d83a2486bd7b53e4a9741736a076e098071b5cbd (patch) | |
tree | d9b6f35a65762d6e54c01e943745ce5ab4c9e38c /usr/src/lib/libc | |
parent | 51396a8ee7fb52fe0ab33bfe7b4f495ad431904a (diff) | |
download | illumos-joyent-d83a2486bd7b53e4a9741736a076e098071b5cbd.tar.gz |
13126 libc: variable dereferenced before check 'found'
Reviewed by: Jason King <jason.brian.king@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/port/gen/crypt.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/usr/src/lib/libc/port/gen/crypt.c b/usr/src/lib/libc/port/gen/crypt.c index 5edc9a1deb..812062644f 100644 --- a/usr/src/lib/libc/port/gen/crypt.c +++ b/usr/src/lib/libc/port/gen/crypt.c @@ -208,10 +208,10 @@ cleanup: * either still allowed or not deprecated. * * RETURN VALUES - * Return a pointer to the new salt, the caller is responsible - * for using free(3c) on the return value. - * Returns NULL on error and sets errno to one of: - * EINVAL, ELIBACC, ENOMEM + * Return a pointer to the new salt, the caller is responsible + * for using free(3c) on the return value. + * Returns NULL on error and sets errno to one of: + * EINVAL, ELIBACC, ENOMEM */ char * crypt_gensalt(const char *oldsalt, const struct passwd *userinfo) @@ -570,7 +570,7 @@ getalgbyname(const char *algname, boolean_t *found) *found = B_TRUE; } } - if (!found) { + if (!(*found)) { errno = EINVAL; goto cleanup; } @@ -731,7 +731,7 @@ free_crypt_policy(struct crypt_policy_s *policy) /* * isa_path - prepend the default dir or patch up the $ISA in path - * Caller is responsible for calling free(3c) on the result. + * Caller is responsible for calling free(3c) on the result. */ static char * isa_path(const char *path) @@ -778,10 +778,10 @@ isa_path(const char *path) /*ARGSUSED*/ static char * _unix_crypt_gensalt(char *gsbuffer, - size_t gsbufflen, - const char *oldpuresalt, - const struct passwd *userinfo, - const char *argv[]) + size_t gsbufflen, + const char *oldpuresalt, + const struct passwd *userinfo, + const char *argv[]) { static const char saltchars[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -807,7 +807,7 @@ _unix_crypt_gensalt(char *gsbuffer, /* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ |