skx / pam_pwnd

A PAM module to test passwords against previous leaks at haveibeenpwned.com
https://blog.steve.fi/tags/haveibeenpwned/
BSD 2-Clause "Simplified" License
36 stars 3 forks source link

strcpy(rest, hash + 5) -> strncpy? #2

Closed AlexanderKurtz closed 6 years ago

AlexanderKurtz commented 6 years ago

https://github.com/skx/pam_pwnd/blob/6abe1caac275e289987384677ec9d7fec1bba827/pwn_chk.c#L54

It might be a good idea to replace this with strncpy() since the was_leaked() function never checks the string length of hash.

skx commented 6 years ago

That's a good catch, thank-you for reading the code so carefully.