Fix crash in hexchat_pluginpref_list()

Set max output size to 4096
This commit is contained in:
TingPing 2013-09-30 01:23:20 -04:00
parent 76b1c2f1ed
commit b7e8f64bba
2 changed files with 3 additions and 3 deletions

View File

@ -1959,7 +1959,7 @@ Module_hexchat_pluginpref_list(PyObject *self, PyObject *args)
{
PluginObject *plugin = (PluginObject*)Plugin_GetCurrent();
hexchat_plugin *prefph = Plugin_GetHandle(plugin);
char list[512];
char list[4096];
char* token;
int result;
PyObject *pylist;

View File

@ -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);