From 3ced31dfa7da11653ae880c2776cbf2e2256a009 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 5 Nov 2024 08:13:07 +0000 Subject: Update to xserver 21.1.14. tested by tb@ The xkb security fix was committed earlier. This is the rest of the 21.1.14 update. --- xserver/hw/xfree86/parser/scan.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'xserver/hw/xfree86/parser/scan.c') diff --git a/xserver/hw/xfree86/parser/scan.c b/xserver/hw/xfree86/parser/scan.c index 1eb35ed73..f4645f9d9 100644 --- a/xserver/hw/xfree86/parser/scan.c +++ b/xserver/hw/xfree86/parser/scan.c @@ -332,10 +332,10 @@ xf86getToken(const xf86ConfigSymTabRec * tab) } while ((c != '\n') && (c != '\r') && (c != '\0')); configRBuf[i] = '\0'; - /* XXX no private copy. + /* XXX private copy. * Use xf86addComment when setting a comment. */ - xf86_lex_val.str = configRBuf; + xf86_lex_val.str = strdup(configRBuf); return COMMENT; } @@ -448,8 +448,11 @@ xf86getSubToken(char **comment) for (;;) { token = xf86getToken(NULL); if (token == COMMENT) { - if (comment) + if (comment) { *comment = xf86addComment(*comment, xf86_lex_val.str); + free(xf86_lex_val.str); + xf86_lex_val.str = NULL; + } } else return token; @@ -464,8 +467,11 @@ xf86getSubTokenWithTab(char **comment, const xf86ConfigSymTabRec * tab) for (;;) { token = xf86getToken(tab); if (token == COMMENT) { - if (comment) + if (comment) { *comment = xf86addComment(*comment, xf86_lex_val.str); + free(xf86_lex_val.str); + xf86_lex_val.str = NULL; + } } else return token; -- cgit v1.2.3