Guest User

Untitled

a guest
Nov 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Fix some lengths in crypt()
  2.  
  3. Use salt_len_in instead of strlen(salt) or PHP_MAX_SALT_LEN, otherwise too
  4. much memory will be allocated.
  5.  
  6. sha512 has a 86 character checksum, not 43. That probably was a copy&paste
  7. from the sha256 code which indeed has 43.
  8.  
  9. The allocation also were using sizeof(char *) instead of sizeof(char), thus
  10. allocating 4 or 8 times as much memory as necessary.
  11.  
  12. The memset 0 call was using PHP_MAX_SALT_LEN which can be smaller then the
  13. output buffer and thus not zeroing out everything. Use the size of the
  14. output buffer (needed) instead.
Add Comment
Please, Sign In to add comment