emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix use of sockaddr_in


From: Philipp Stephani
Subject: Re: [PATCH] Fix use of sockaddr_in
Date: Mon, 15 May 2017 09:04:56 +0000



Paul Eggert <address@hidden> schrieb am Mo., 15. Mai 2017 um 08:15 Uhr:
Eli Zaretskii wrote:
> if your
> intent was to say that this condition should be added to the code,
> i.e. for AF_UNIX we should not try to compute the port, then I agree.

I installed a modified version of Philipp's patch, to do that. Thanks, Philipp,
for tracking this down.

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d23a486ba27405acfda67a4dc387ade5e399a29b

Thanks! A few questions to guard against undefined behavior:
- Maybe add verify(INT_MAX >= TYPE_MAXIMUM(in_port_t)) and verify(TYPE_MINIMUM(in_port_t) == 0) to make sure that we can use int for the port?
- Should there be a guard against the alias violation, e.g. by declaring sa and sa1 with __attribute__((may_alias))? Otherwise it's UB and the compiler might elide the switch entirely. 
--

Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank.

This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]