Add input validation for OBJECT parameter in tp--parse-match-args

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-15 13:26:42 +00:00
parent c3ba26872a
commit 95c3d79f4b

3
tp.el
View File

@ -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)." Where PLIST is a property list and OBJECT is a buffer or string (nil for current buffer)."
(let ((plist (car args)) (let ((plist (car args))
(object (cadr 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))) (cons object plist)))
(defun tp--deep-merge-apply (start end props obj) (defun tp--deep-merge-apply (start end props obj)