summaryrefslogtreecommitdiff
path: root/src/common/md5calc.cpp
diff options
context:
space:
mode:
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';