]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Fix fscanf() usage without size limit
authorPatrick Griffis <redacted>
Sun, 11 Mar 2018 23:08:26 +0000 (19:08 -0400)
committerPatrick Griffis <redacted>
Sun, 11 Mar 2018 23:08:26 +0000 (19:08 -0400)
Closes #2137

src/common/plugin.c

index b99c440360e81e3c7549e84500226daab2a3f971..3ad3c558ecaded03bb9c30ac96ea6523ffeed8e3 100644 (file)
@@ -2010,7 +2010,7 @@ hexchat_pluginpref_list (hexchat_plugin *pl, char* dest)
        else                                                                                                    /* existing config file, get list of settings */
        {
                strcpy (dest, "");                                                                      /* clean up garbage */
-               while (fscanf (fpIn, " %[^\n]", bufp) != EOF)   /* read whole lines including whitespaces */
+               while (fscanf (fpIn, " %511[^\n]", bufp) != EOF)        /* read whole lines including whitespaces */
                {
                        token = strtok (buffer, "=");
                        g_strlcat (dest, g_strchomp (token), 4096); /* Dest must not be smaller than this */