refixed buffer overflow
[claws.git] / src / quote_fmt_parse.y
index bdbcd7aac6c80a7630b08841446bcd8e0d46887e..a28647fb5e948278eebc07d9d1a61fc0c5b84546 100644 (file)
@@ -205,12 +205,12 @@ string:
                int len;
                
                strncpy($$, $1, sizeof($$));
+               $$[sizeof($$) - 1] = '\0';
                len = strlen($$);
                if (len + 1 < sizeof($$)) {
                        $$[len + 1] = '\0';
                        $$[len] = $2;
                }
-               $$[sizeof($$) - 1] = '\0';
        };
 
 special: