This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Fix connect/sendto/sendmsg into making sure to ignore bytes beyond sockaddr length
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Samuel Thibault <samuel dot thibault at gnu dot org>
- Cc: libc-alpha at sourceware dot org, bug-hurd at gnu dot org
- Date: Sat, 7 Feb 2015 18:12:51 -0800 (PST)
- Subject: Re: [PATCH] Fix connect/sendto/sendmsg into making sure to ignore bytes beyond sockaddr length
- Authentication-results: sourceware.org; auth=none
- References: <20150207213041 dot GT3023 at type dot youpi dot perso dot aquilenet dot fr>
> Thanks Tanaka Akira for the report.
General glibc policy is that if a bug was user-visible (i.e. observable in
a user program that was not itself using undefined behavior, etc.) then
there should be a bugzilla item filed for it. That BZ# should then be
in the ChangeLog entry.
> --- /dev/null
> +++ b/hurd/hurdsocket.h
Because of its particular content and modern re-#define rules, this file
will actually work OK without a multiple inclusion guard. But normal
practice is to have one, so please do.
> +#define _hurd_sun_path_dupa(__addr, __len) \
> + strndupa ((__addr)->sun_path, (__len) - offsetof (struct sockaddr_un, sun_path))
Don't use __ names for macro arguments. There's no need. This should
really have a comment saying both what precisely it does, and where and why
it's important to use it.
Otherwise this looks fine.