From a1e454d6df011f2a02d3b4900dd33d1d3717c6ef Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 29 Mar 2021 13:39:43 +0300 Subject: [PATCH] Protect add-variable-watcher from incorrect usage * src/data.c (Fadd_variable_watcher): Avoid crashes if SYMBOL isn't. (Bug#47462) --- src/data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data.c b/src/data.c index 0fa491b17a1..3667b03c0e4 100644 --- a/src/data.c +++ b/src/data.c @@ -1589,6 +1589,7 @@ All writes to aliases of SYMBOL will call WATCH-FUNCTION too. */) (Lisp_Object symbol, Lisp_Object watch_function) { symbol = Findirect_variable (symbol); + CHECK_SYMBOL (symbol); set_symbol_trapped_write (symbol, SYMBOL_TRAPPED_WRITE); map_obarray (Vobarray, harmonize_variable_watchers, symbol); -- 2.39.2