summaryrefslogtreecommitdiff
path: root/src/common/md5calc.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-06-22 22:30:13 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-06-23 22:07:50 -0700
commitdbbfda0e96037da4f208ff8f00d181a5294484ae (patch)
tree7a7b9982c6d98ddc2271aade72040ea9233a4a11 /src/common/md5calc.cpp
parent83db3bbee4e19e7426a32ee89ad6c2d8e48260f2 (diff)
downloadtmwa-dbbfda0e96037da4f208ff8f00d181a5294484ae.tar.gz
tmwa-dbbfda0e96037da4f208ff8f00d181a5294484ae.tar.bz2
tmwa-dbbfda0e96037da4f208ff8f00d181a5294484ae.tar.xz
tmwa-dbbfda0e96037da4f208ff8f00d181a5294484ae.zip
add new stuff stuff (with tests!), poison memcmp and strncpy
Diffstat (limited to 'src/common/md5calc.cpp')
-rw-r--r--src/common/md5calc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/md5calc.cpp b/src/common/md5calc.cpp
index f773c9f..582c152 100644
--- a/src/common/md5calc.cpp
+++ b/src/common/md5calc.cpp
@@ -317,7 +317,8 @@ const char *make_salt(void)
bool pass_ok(const char *password, const char *crypted)
{
char buf[40];
- strncpy(buf, crypted, 40);
+ strzcpy(buf, crypted, 40);
+ // crypted is like !salt$hash
char *salt = buf + 1;
*strchr(salt, '$') = '\0';