Skip to content

Commit

Permalink
Fix variable overflow on 'sha256_crypt_r'
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierJF committed Jan 22, 2024
1 parent 29b7cd0 commit e93b243
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sha256crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ char * sha256_crypt_r (const char *key, const char *salt, char *buffer, int bufl
sha256_init_ctx (&alt_ctx);

/* For every character in the password add the entire password. */
for (unsigned char cnta = 0; cnta < 16 + alt_result[0]; ++cnta)
for (cnt = 0; cnt < static_cast<size_t>(16) + alt_result[0]; ++cnt)
sha256_process_bytes (salt, salt_len, &alt_ctx);

/* Finish the digest. */
Expand Down

0 comments on commit e93b243

Please sign in to comment.