diff options
author | JSDurand <mmemmew@gmail.com> | 2021-12-11 00:03:12 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-12-11 00:03:12 +0800 |
commit | 55130d47a0db36950df1563221f654d3378d93a1 (patch) | |
tree | c6cfbc176f66e2793ab9e25a39beea065e933bb0 | |
parent | 34130eb4f6bbc05f0bfe6102e44eb9762c957370 (diff) |
eww-conf: stringp adds security
* eww-conf.el (durand-eww-bookmark-jump): Using stringp to check if a
variable is really a string, so that the function that depends on it
being a string won't fail unexpectedly (to the user).
-rw-r--r-- | eww-conf.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/eww-conf.el b/eww-conf.el index a8fbd62..aaf48d3 100644 --- a/eww-conf.el +++ b/eww-conf.el @@ -516,14 +516,18 @@ Otherwise, fetch URL and afterwards try to restore the point." (cond (reuse-p (set-buffer reuse-p) - ;; we may use the default handler to restore the position here + ;; we may use the default handler to restore the position + ;; here (with-current-buffer reuse-p (goto-char (cdr position)) (cond - ((search-forward (cdr front) nil t) + ((and + (stringp (cdr front)) + (search-forward (cdr front) nil t)) (goto-char (match-beginning 0)))) (cond - ((search-forward (cdr rear) nil t) + ((and (stringp (cdr rear)) + (search-forward (cdr rear) nil t)) (goto-char (match-end 0)))))) (t ;; HACK, GIANT HACK! |