]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
Omit the server name internally when building a /STATS reply and prepend it later
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index 5fea846daccadcf1b8d3c1e6bf60064363583384..b3b5f2c7619e1eef2cf958f89b84f71535d5c480 100644 (file)
@@ -181,7 +181,7 @@ class ModuleAlias : public Module
                }
 
                // fcommands are only for local users. Spanningtree will send them back out as their original cmd.
-               if (!user || !IS_LOCAL(user))
+               if (!IS_LOCAL(user))
                {
                        return;
                }
@@ -310,11 +310,11 @@ class ModuleAlias : public Module
                for (unsigned int i = 0; i < newline.length(); i++)
                {
                        char c = newline[i];
-                       if (c == '$')
+                       if ((c == '$') && (i + 1 < newline.length()))
                        {
                                if (isdigit(newline[i+1]))
                                {
-                                       int len = (newline[i+2] == '-') ? 3 : 2;
+                                       int len = ((i + 2 < newline.length()) && (newline[i+2] == '-')) ? 3 : 2;
                                        std::string var = newline.substr(i, len);
                                        result.append(GetVar(var, original_line));
                                        i += len - 1;