Permalink
Browse files

Fix dh-blowfish in sasl module and #230

Idea for the patch by psychon
  • Loading branch information...
1 parent 48aa157 commit 50e6c1bfabf8b9a4c5ab5a0718e1c77ae18138d5 @DarthGandalf DarthGandalf committed Sep 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 modules/sasl.cpp
View
4 modules/sasl.cpp
@@ -320,8 +320,8 @@ class CSASLMod : public CModule {
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);

0 comments on commit 50e6c1b

Please sign in to comment.