]> git.ipfire.org Git - people/ms/dma.git/commitdiff
parse_conf: fix bug with masqueraded domains
authorSimon Schubert <2@0x2c.org>
Mon, 2 Jan 2012 19:40:22 +0000 (20:40 +0100)
committerSimon Schubert <2@0x2c.org>
Mon, 2 Jan 2012 19:40:22 +0000 (20:40 +0100)
We need to clear the @ symbol instead of NULLing the pointer.

Found-by: clang static analysis
conf.c

diff --git a/conf.c b/conf.c
index 29b6e1bdbdbc9755ac633988136b9d6da133b1b3..4e15b59990f8ddb8c53cb041a934a1ebf2f912be 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -207,7 +207,7 @@ parse_conf(const char *config_path)
                        char *user = NULL, *host = NULL;
                        if (strrchr(data, '@')) {
                                host = strrchr(data, '@');
-                               host = 0;
+                               *host = 0;
                                host++;
                                user = data;
                        } else {