]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix oversights in substr() conversion
authorAttila Molnar <attilamolnar@hush.com>
Fri, 27 Feb 2015 00:25:12 +0000 (01:25 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 27 Feb 2015 00:25:12 +0000 (01:25 +0100)
Thanks to @StevenVanAcker for reporting and testing this

src/modules/m_ldapauth.cpp
src/users.cpp

index 804f6b82122ed85b7022ce88db180f6e9d7bca71..7da63284a47a430074d1607f4add6728dc633090 100644 (file)
@@ -64,7 +64,7 @@ class BindInterface : public LDAPInterface
                                while (i < text.length() - 1 && isalpha(text[i + 1]))
                                        ++i;
 
-                               std::string key(start, (i - start) + 1);
+                               std::string key(text, start, (i - start) + 1);
                                result.append(replacements[key]);
                        }
                        else
index 12243c64b074df57ab7442f4b5e8a782d79c5858..d760c713f30803be77e026a8aab06b0c56c8a861 100644 (file)
@@ -764,7 +764,7 @@ void LocalUser::Write(const std::string& text)
        if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
        {
                // this should happen rarely or never. Crop the string at 512 and try again.
-               std::string try_again(0, ServerInstance->Config->Limits.MaxLine - 2);
+               std::string try_again(text, 0, ServerInstance->Config->Limits.MaxLine - 2);
                Write(try_again);
                return;
        }