[openwrt/openwrt] ucode: fix parsing \xHH and \0OOO escape sequences
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 5 02:31:47 PDT 2025
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a64db95a23dfabc40e429efa928d4c2cec75874f
commit a64db95a23dfabc40e429efa928d4c2cec75874f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Oct 5 11:30:48 2025 +0200
ucode: fix parsing \xHH and \0OOO escape sequences
Both need to add add bytes, not UTF-8 sequences.
Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
...fix-parsing-xHH-and-0OOO-escape-sequences.patch | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/package/utils/ucode/patches/100-lexer-fix-parsing-xHH-and-0OOO-escape-sequences.patch b/package/utils/ucode/patches/100-lexer-fix-parsing-xHH-and-0OOO-escape-sequences.patch
new file mode 100644
index 0000000000..70845259f7
--- /dev/null
+++ b/package/utils/ucode/patches/100-lexer-fix-parsing-xHH-and-0OOO-escape-sequences.patch
@@ -0,0 +1,29 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 5 Oct 2025 11:25:15 +0200
+Subject: [PATCH] lexer: fix parsing \xHH and \0OOO escape sequences
+
+Both need to add add bytes, not UTF-8 sequences.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/lexer.c
++++ b/lexer.c
+@@ -277,7 +277,7 @@ parse_escape(uc_lexer_t *lex, const char
+ code = code * 16 + hex(ch);
+ }
+
+- append_utf8(lex, code);
++ uc_vector_push(&lex->buffer, code);
+ }
+
+ /* octal or letter */
+@@ -293,7 +293,7 @@ parse_escape(uc_lexer_t *lex, const char
+ if (code > 255)
+ return emit_op(lex, -3, TK_ERROR, ucv_string_new("Invalid escape sequence"));
+
+- append_utf8(lex, code);
++ uc_vector_push(&lex->buffer, code);
+ }
+
+ /* ... no octal sequence, handle potential regex macros */
More information about the lede-commits
mailing list