From c2f32fb03fa863bceeb7266c35b6ec76c7c843af Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Wed, 25 Feb 2026 15:50:24 -0600 Subject: [PATCH] Support more sprintf format strings for patching. --- chb/buffer/LibraryCallCallsites.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chb/buffer/LibraryCallCallsites.py b/chb/buffer/LibraryCallCallsites.py index 6847fa40..cbb7219c 100644 --- a/chb/buffer/LibraryCallCallsites.py +++ b/chb/buffer/LibraryCallCallsites.py @@ -358,7 +358,8 @@ def known_input_length(self) -> Optional[str]: fmtarg = self.instr.call_arguments[1] if fmtarg.is_string_reference: fmtstr = (cast(XprConstant, fmtarg)).constant.string_reference() - if not "%s" in fmtstr: + # TODO: Smarter heuristics for problematic length fmt strings + if not "%" in fmtstr: return "sprintf:max_length_fmt" else: return None @@ -368,7 +369,8 @@ def known_input_length(self) -> Optional[str]: fmtarg = self.instr.call_arguments[2] if fmtarg.is_string_reference: fmtstr = (cast(XprConstant, fmtarg)).constant.string_reference() - if not "%s" in fmtstr: + # TODO: Smarter heuristics for problematic length fmt strings + if not "%" in fmtstr: return "snprintf:max_length_fmt" else: return None