From 1f7a1d489ebfd6b3ef784005b2a52b327979fc58 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 24 Aug 2017 06:38:32 -0700 Subject: trie filtering: ensure we don't misuse string_extend. * filter.c (trie_filter_string): If a trie node is associated with a filter substitute object that isn't a character or string, then convert that to a string using tostringp. It could be an integer. If so and we feed that to string_extend, it will extend the string. --- filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filter.c b/filter.c index 11637a29..37a27bcb 100644 --- a/filter.c +++ b/filter.c @@ -280,6 +280,8 @@ static val trie_filter_string(val filter, val str) } if (match) { + if (!stringp(subst) && chrp(subst)) + subst = tostringp(subst); string_extend(out, subst); i = plus(match, one); } else { -- cgit v1.2.3