]> granicus.if.org Git - linux-pam/commitdiff
Write to *rounds only if non-NULL.
authorTomas Mraz <tmraz@fedoraproject.org>
Fri, 13 Sep 2013 13:20:01 +0000 (15:20 +0200)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 13 Sep 2013 13:20:01 +0000 (15:20 +0200)
modules/pam_unix/support.c(_set_ctrl): Write to *rounds only if non-NULL.

modules/pam_unix/support.c

index d8f4a6f7cdae050101cbf922e4775789173baafe..9284dbaa08f4a4422a8f2493b3dd266d930e73b3 100644 (file)
@@ -176,7 +176,7 @@ int _set_ctrl(pam_handle_t *pamh, int flags, int *remember, int *rounds,
          free (val);
 
          /* read number of rounds for crypt algo */
-         if (on(UNIX_SHA256_PASS, ctrl) || on(UNIX_SHA512_PASS, ctrl)) {
+         if (rounds && (on(UNIX_SHA256_PASS, ctrl) || on(UNIX_SHA512_PASS, ctrl))) {
            val=search_key ("SHA_CRYPT_MAX_ROUNDS", LOGIN_DEFS);
 
            if (val) {