1
0
forked from GitHub/gf-core

safe parsing of "" and ''

This commit is contained in:
Krasimir Angelov
2022-06-16 11:22:15 +02:00
parent 247a48e5bb
commit ad8a32ce86

View File

@@ -508,6 +508,12 @@ void PgfExprParser::token()
if (ch == '\'') {
getc();
token_tag = PGF_TOKEN_IDENT;
if (token_value == NULL) {
token_value = (PgfText*)
malloc(sizeof(PgfText)+1);
token_value->size = 0;
token_value->text[0] = 0;
}
}
}
break;
@@ -521,6 +527,12 @@ void PgfExprParser::token()
if (ch == '"') {
getc();
token_tag = PGF_TOKEN_STR;
if (token_value == NULL) {
token_value = (PgfText*)
malloc(sizeof(PgfText)+1);
token_value->size = 0;
token_value->text[0] = 0;
}
}
}
break;