[Top][All Lists]

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

Re: [PATCH] Fix use of sockaddr_in

From: Eli Zaretskii
Subject: Re: [PATCH] Fix use of sockaddr_in
Date: Sat, 13 May 2017 19:52:02 +0300

> From: Philipp Stephani <address@hidden>
> Date: Sat, 13 May 2017 17:08:37 +0200
> Cc: Philipp Stephani <address@hidden>
> Fixes an access violation detected by AddressSanitizer.
> * process.c (connect_network_socket): Use sockaddr_storage
> structure instead of sockaddr_in.  Only sockaddr_storage is
> guaranteed to be large enough for all address families.


The first hunk doesn't seem to be necessary, though: in both IPv4 and
IPv6 structures, the port is at the same offset and has the same size.
So I'd rather put an assertion there, to verify that the offsets and
sizes are the same (because the standards don't guarantee that), and
that's all.

reply via email to

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