From 50e6c1bfabf8b9a4c5ab5a0718e1c77ae18138d5 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Wed, 19 Sep 2012 08:38:09 +0700 Subject: [PATCH] Fix dh-blowfish in sasl module and #230 Idea for the patch by psychon --- modules/sasl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sasl.cpp b/modules/sasl.cpp index 8eb5f665..9f962506 100644 --- a/modules/sasl.cpp +++ b/modules/sasl.cpp @@ -320,8 +320,8 @@ public: DH_free(dh); /* Add sasl username to response */ - memcpy(out_ptr, GetNV("username").c_str(), GetNV("username").size()); - out_ptr += GetNV("username").size() + 1; + memcpy(out_ptr, GetNV("username").c_str(), GetNV("username").length() + 1); // +1 for zero byte in the end + out_ptr += GetNV("username").length() + 1; /* Finally add the encrypted password to the response */ memcpy(out_ptr, encrypted_password, password_length);