From 220225f4ff5ff4a9830e31f097b6bb732d379538 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Mon, 11 Nov 2013 13:37:14 +0000 Subject: [PATCH] whowas.c: Apply patch from tau replacing sprintf() with snprintf(). git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@441 13b04d17-f746-0410-82c6-800466cd88b0 --- source/whowas.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/whowas.c b/source/whowas.c index e187f9e..0ccddd7 100644 --- a/source/whowas.c +++ b/source/whowas.c @@ -237,13 +237,14 @@ WhowasList *tmp; /* Used to rehash whowas listings for new shitlist entries */ void sync_whowas_addshit(ShitList *added) { -WhowasList *tmp; -char user[BIG_BUFFER_SIZE]; + WhowasList *tmp; + char user[BIG_BUFFER_SIZE]; + for (tmp = next_userhost(&whowas_userlist_list, NULL); tmp; tmp = next_userhost(&whowas_userlist_list, tmp)) { if (check_channel_match(added->channels, tmp->channel)) { - sprintf(user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host); + snprintf(user, sizeof user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host); if (wild_match(added->filter, user)) tmp->nicklist->shitlist = added; } @@ -252,7 +253,7 @@ char user[BIG_BUFFER_SIZE]; { if (check_channel_match(added->channels, tmp->channel)) { - sprintf(user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host); + snprintf(user, sizeof user, "%s!%s", tmp->nicklist->nick, tmp->nicklist->host); if (wild_match(added->filter, user)) tmp->nicklist->shitlist = added; }