Thanks much to Tomasz for merging a number of Apple's changes into jabberd.  
While working with 2.2.16, I noticed a bug in the s2s whitelist code which 
could be fixed using the following patch (vs. top of tree):

--- jabberd2/s2s/main.c.orig    2012-05-14 22:00:41.000000000 -0700
+++ jabberd2/s2s/main.c 2012-05-14 22:00:53.000000000 -0700
@@ -634,7 +634,7 @@
         s2s->whitelist_domains[j] = (char *) malloc(sizeof(char) * 
(elem_len+1));
         memset(s2s->whitelist_domains[j], 0, (sizeof(char) * (elem_len+1)));
         strncpy(s2s->whitelist_domains[j], values[i], elem_len);
-        s2s->whitelist_domains[j][elem_len+1] = '\0';
+        s2s->whitelist_domains[j][elem_len] = '\0';
         log_debug(ZONE, "s2s whitelist domain read from file: %s\n", 
s2s->whitelist_domains[j]);
         j++;
     }

I actually replaced the strncpy with strlcpy, but this change should work as 
well.  I guess technically you could just remove the problematic line.

-Joel Hedden


Reply via email to