summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-09-30 01:23:20 -0400
committerTingPing <tingping@tingping.se>2013-09-30 01:23:20 -0400
commitb7e8f64bbaea4b78e8a744ca94082528c3eda4dd (patch)
tree9d2c57e97aff71a88f41513e46d9d7eb8c7e9901 /src
parent76b1c2f1edca3327d23962fe27be3588f114d3bd (diff)
Fix crash in hexchat_pluginpref_list()
Set max output size to 4096
Diffstat (limited to 'src')
-rw-r--r--src/common/plugin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c
index d186679a..117e2d33 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -2015,8 +2015,8 @@ hexchat_pluginpref_list (hexchat_plugin *pl, char* dest)
 		while (fscanf (fpIn, " %[^\n]", bufp) != EOF)	/* read whole lines including whitespaces */
 		{
 			token = strtok (buffer, "=");
-			strncat (dest, token, strlen (token) - 1);
-			strcat (dest, ",");
+			g_strlcat (dest, token, 4096); /* Dest must not be smaller than this */
+			g_strlcat (dest, ",", 4096);
 		}
 
 		fclose (fpIn);