1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00

Protect against bad results from libravatar

* lisp/image/gravatar.el (gravatar--service-libravatar): Don't
have (gravatar-retrieve "foobar@zjp.codes" 'ignore) (which returns
a CNAME) bug out.
This commit is contained in:
Lars Ingebrigtsen 2021-01-28 13:10:45 +01:00
parent 64d4648869
commit 0120f45db6

View File

@ -160,12 +160,16 @@ to track whether you're reading a specific mail."
(cond
((and
result ;there is a result
(let* ((data (mapcar (lambda (record)
(let* ((answers (dns-get 'answers result))
(data (mapcar (lambda (record)
(dns-get 'data (cdr record)))
(dns-get 'answers result)))
(priorities (mapcar (lambda (r)
(dns-get 'priority r))
data))
;; We may get junk data back (or CNAME;
;; ignore).
(and (eq (dns-get 'type answers) 'SRV)
answers)))
(priorities (and (mapcar (lambda (r)
(dns-get 'priority r))
data)))
(max-priority (if priorities
(apply #'max priorities)
0))