fix off-by-one for end-NUL in strcpy bug
authorTero Marttila <terom@fixme.fi>
Wed, 01 Apr 2009 00:26:50 +0300
changeset 101 bb8ed1382103
parent 100 cfb7776bd6f0
child 102 af4190b743a5
fix off-by-one for end-NUL in strcpy bug
src/irc_conn.c
--- a/src/irc_conn.c	Tue Mar 31 23:36:05 2009 +0300
+++ b/src/irc_conn.c	Wed Apr 01 00:26:50 2009 +0300
@@ -139,7 +139,7 @@
 static void irc_conn_on_CTCP (struct irc_conn *conn, const struct irc_line *line)
 {
     // copy the message data into a mutable buffer
-    char data_buf[strlen(line->args[1])], *data = data_buf;
+    char data_buf[strlen(line->args[1]) + 1], *data = data_buf;
     strcpy(data_buf, line->args[1]);
 
     // should only be called when this is true...