[PATCH] Fix connect/sendto/sendmsg into making sure to ignore bytes beyond sockaddr length
Roland McGrath
roland@hack.frob.com
Sun Feb 8 02:12:00 GMT 2015
> 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.
Thanks,
Roland
More information about the Libc-alpha
mailing list