diff options
author | rillig <rillig@pkgsrc.org> | 2007-03-08 14:38:31 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-03-08 14:38:31 +0000 |
commit | cd3c1a4214409b61a20880e524f9abd48f31a47f (patch) | |
tree | ef7893fbc2a6ab96063b14e616af46ff1aded23c | |
parent | 3681b411992b1446a4e8225f42122dd9ab7b37a4 (diff) | |
download | pkgsrc-cd3c1a4214409b61a20880e524f9abd48f31a47f.tar.gz |
Using offsetof() instead of a null pointer dereference fixes a g++ error
message. Fixes PR 35950.
-rw-r--r-- | x11/kdebase3/distinfo | 3 | ||||
-rw-r--r-- | x11/kdebase3/patches/patch-kdesud | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/x11/kdebase3/distinfo b/x11/kdebase3/distinfo index 51308444e24..6df89535f11 100644 --- a/x11/kdebase3/distinfo +++ b/x11/kdebase3/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.94 2007/02/15 14:06:48 joerg Exp $ +$NetBSD: distinfo,v 1.95 2007/03/08 14:38:31 rillig Exp $ SHA1 (Daemon.README) = eb1e6af52adc02ded77af17e8953134b7e60d23b RMD160 (Daemon.README) = 39edd92ed4314397080f32a8caff0ac3f716ecf4 @@ -58,3 +58,4 @@ SHA1 (patch-ga) = 40ab73f3e32e8d8e8c58662df7c5dc54bd4acd29 SHA1 (patch-gb) = b36e23cf6c64e42269b396f389c5a0e24a40e67e SHA1 (patch-gc) = e02ddb93ae7aa249b3b3e68690f587b2c98255b8 SHA1 (patch-gd) = 39469384668e4ee7fc489406e2813100fc90aa9b +SHA1 (patch-kdesud) = acc40c2d1fb65e404a7aa0dbb6eae72fa7ac6a5e diff --git a/x11/kdebase3/patches/patch-kdesud b/x11/kdebase3/patches/patch-kdesud new file mode 100644 index 00000000000..4e8f94ec46a --- /dev/null +++ b/x11/kdebase3/patches/patch-kdesud @@ -0,0 +1,18 @@ +$NetBSD: patch-kdesud,v 1.1 2007/03/08 14:38:31 rillig Exp $ + +g++ 4.1.2 says: +kdesud.cpp:210: error: cast from 'char*' to 'socklen_t' loses precision + +--- kdesu/kdesud/kdesud.cpp.orig 2005-09-10 10:26:13.000000000 +0200 ++++ kdesu/kdesud/kdesud.cpp 2007-03-08 15:18:25.000000000 +0100 +@@ -77,8 +77,8 @@ + #include <X11/Xlib.h> + + #ifndef SUN_LEN +-#define SUN_LEN(ptr) ((kde_socklen_t) (((struct sockaddr_un *) 0)->sun_path) \ +- + strlen ((ptr)->sun_path)) ++#define SUN_LEN(ptr) ((kde_socklen_t) \ ++ (offsetof(struct sockaddr_un, sun_path) + strlen ((ptr)->sun_path))) + #endif + + #define ERR strerror(errno) |