aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-27 21:00:42 -0300
committerdequis <dx@dxzone.com.ar>2015-11-27 21:04:07 -0300
commit31d993029df984445ee54c2321976f370bc05460 (patch)
tree74b6261cea3a06a47a229a4a03e141dac5214cf5 /irc_im.c
parent47ab9a9c9411f14bb95da9bfb97a943e1c531c48 (diff)
bee_irc_user_new: Use str_reject_chars to sanitize both user and host
Fixes trac ticket 1195: https://bugs.bitlbee.org/bitlbee/ticket/1195 I had no idea how to reproduce that bug until I tried with libpurple. The built-in jabber never had this problem.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/irc_im.c b/irc_im.c
index fe279abe..0b0b0274 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -83,9 +83,9 @@ static gboolean bee_irc_user_new(bee_t *bee, bee_user_t *bu)
}
}
- while ((s = strchr(iu->user, ' '))) {
- *s = '_';
- }
+ /* Sanitize */
+ str_reject_chars(iu->user, " ", '_');
+ str_reject_chars(iu->host, " ", '_');
if (bu->flags & BEE_USER_LOCAL) {
char *s = set_getstr(&bee->set, "handle_unknown");