Summary: | [PATCH] please use offsetof for manipulating struct sockaddr_un | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | petr.salinger | ||||||
Component: | Lib/xtrans | Assignee: | Alan Coopersmith <alan.coopersmith> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | high | CC: | rmh | ||||||
Version: | git | Keywords: | patch | ||||||
Hardware: | x86 (IA32) | ||||||||
OS: | other | ||||||||
Whiteboard: | |||||||||
i915 platform: | i915 features: | ||||||||
Attachments: |
|
Description
petr.salinger
2005-11-07 13:26:49 UTC
Actually according to POSIX1.2004, you don't even't need to use strlen and offsetof, you can use sizeof(struct sockaddr_un) instead. Tested with a FreeBSD kernel and a Linux kernel. POSIX1.2004, page 263 says: "address_len Specifies the length of the sockaddr structure pointed to by the address argument." Reassigning to modular xlibs. Created attachment 5404 [details] [review] updated patch for CVS HEAD ... and back to xorg. xlibs is dead. Created attachment 5424 [details] [review] updated patch for CVS HEAD there have been a typo in last chunk Patch committed to git head: commit 2495789d6c290e2037b2836f28b027786ea5b605 Author: Petr Salinger <petr.salinger@t-systems.cz> Date: Sun Apr 23 01:31:00 2006 -0700 Bug 4982: use offsetof for manipulating struct sockaddr_un X.Org Bugzilla #4982 <https://bugs.freedesktop.org/show_bug.cgi?id=4982> Patch #5424 <https://bugs.freedesktop.org/attachment.cgi?id=5424> Thanks for the patch! (I've also committed a followon that uses SUN_LEN if it's defined, even when BSD44SOCKETS is not.) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.