[Top][All Lists]

[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.


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]