]> asedeno.scripts.mit.edu Git - 1ts-debian.git/commitdiff
replace gratuitous use sprintf with strncpy and edifying comment. Also fix fencepost...
authorkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Mon, 22 Dec 2008 18:15:15 +0000 (18:15 +0000)
committerkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Mon, 22 Dec 2008 18:15:15 +0000 (18:15 +0000)
git-svn-id: svn://svn.1ts.org/debian/branches/zephyr-reloaded@381 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f

zephyr/server/dispatch.c

index ae65cc4d1802856412784a0a6d4620cd186abfdc..28d39ecbd48d032b6e575b6ab8af9d12c5fa6c4d 100644 (file)
@@ -389,8 +389,12 @@ sendit(ZNotice_t *notice,
       strncpy(recipbuf, notice->z_recipient, sizeof(recipbuf));
       recipp = strrchr(recipbuf, '@');
       if (recipp)
-       snprintf(recipp + 1, sizeof(recipbuf) - (recipp - recipbuf),
-                "%s", realm_expand_realm(recipp + 1));
+       /* XXX if realm_expand_realm doesn't find a match
+        * it returns what's passed into it, causing an overlapping
+        * copy, the results of which are undefined.
+        */
+       strncpy(recipp + 1, realm_expand_realm(recipp + 1),
+              sizeof(recipbuf) - (recipp - recipbuf) - 1);
       dest.recip = make_string(recipbuf, 0);
     }