* Re: master 0120f45: Protect against bad results from libravatar
[not found] ` <20210128121105.42B6E20B72@vcs0.savannah.gnu.org>
@ 2021-01-28 14:35 ` Basil L. Contovounesios
2021-01-29 4:53 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Basil L. Contovounesios @ 2021-01-28 14:35 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: emacs-devel
larsi@gnus.org (Lars Ingebrigtsen) writes:
> branch: master
> commit 0120f45db630753bc8c4d6c43f7cdb7f953144fd
> Author: Lars Ingebrigtsen <larsi@gnus.org>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
> 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.
> ---
> lisp/image/gravatar.el | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
> index 4f37834..b1e2a31 100644
> --- a/lisp/image/gravatar.el
> +++ b/lisp/image/gravatar.el
> @@ -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)
^^^
Spurious 'and'?
> + (dns-get 'priority r))
> + data)))
> (max-priority (if priorities
> (apply #'max priorities)
> 0))
AKA (apply #'max 0 priorities).
Thanks,
--
Basil
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: master 0120f45: Protect against bad results from libravatar
2021-01-28 14:35 ` master 0120f45: Protect against bad results from libravatar Basil L. Contovounesios
@ 2021-01-29 4:53 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-29 4:53 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: emacs-devel
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
> Spurious 'and'?
>
>> + (dns-get 'priority r))
>> + data)))
>> (max-priority (if priorities
>> (apply #'max priorities)
>> 0))
>
> AKA (apply #'max 0 priorities).
Yup; fixed now.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-29 4:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210128121103.9120.509@vcs0.savannah.gnu.org>
[not found] ` <20210128121105.42B6E20B72@vcs0.savannah.gnu.org>
2021-01-28 14:35 ` master 0120f45: Protect against bad results from libravatar Basil L. Contovounesios
2021-01-29 4:53 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).