Check if crypt_method null before dereferencing
Make sure crypto_method set before sha-rounds. Only affects newusers.
This commit is contained in:
@@ -662,6 +662,13 @@ static void process_flags (int argc, char **argv)
|
||||
case 's':
|
||||
sflg = true;
|
||||
bad_s = 0;
|
||||
|
||||
if (!crypt_method){
|
||||
fprintf(stderr,
|
||||
_("%s: Provide '--crypt-method'\n"),
|
||||
Prog);
|
||||
usage (EXIT_FAILURE);
|
||||
}
|
||||
#if defined(USE_SHA_CRYPT)
|
||||
if ( ( ((0 == strcmp (crypt_method, "SHA256")) || (0 == strcmp (crypt_method, "SHA512")))
|
||||
&& (0 == getlong(optarg, &sha_rounds)))) {
|
||||
|
||||
Reference in New Issue
Block a user