From 95c3d79f4b4ed2bffc18e1559353523c369bd8b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 13:26:42 +0000 Subject: [PATCH] Add input validation for OBJECT parameter in tp--parse-match-args Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com> --- tp.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tp.el b/tp.el index 391b4e6..99c8f94 100644 --- a/tp.el +++ b/tp.el @@ -822,6 +822,9 @@ Supports the calling convention: Where PLIST is a property list and OBJECT is a buffer or string (nil for current buffer)." (let ((plist (car args)) (object (cadr args))) + ;; Validate object if provided + (when (and object (not (or (stringp object) (bufferp object)))) + (error "OBJECT must be a string or buffer, got: %S" object)) (cons object plist))) (defun tp--deep-merge-apply (start end props obj)