]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
Limit corrections on strings to <= 16 bytes. Otherwise memory usage spikes instantly...
[xonotic/gmqcc.git] / parser.c
index 5b4ed658f96f5236ed04f7db1aed7d1a4dabd534..d6490d4cd545be1a630cddf351b2107443d7295b 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1936,7 +1936,7 @@ static bool parse_sya_operand(parser_t *parser, shunt *sy, bool with_labels)
                  * We should also consider adding correction tables for
                  * other things as well.
                  */
-                if (OPTS_OPTION_BOOL(OPTION_CORRECTION)) {
+                if (OPTS_OPTION_BOOL(OPTION_CORRECTION) && strlen(parser_tokval(parser)) <= 16) {
                     correction_t corr;
                     correct_init(&corr);
 
@@ -4339,7 +4339,7 @@ static bool parse_function_body(parser_t *parser, ast_value *var)
     }
 
     vec_push(func->blocks, block);
-    
+
 
     parser->function = old;
     if (!parser_leaveblock(parser))