summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-05-20 00:39:45 +0200
committerWerner Koch <wk@gnupg.org>2009-05-20 00:39:45 +0200
commit4fa261f8ecb16fabb4d06403f6ffacaa010ce453 (patch)
treef2786955474b37c97172d5dbf932e17bc48a2543 /common
parentRemove testing cruft. (diff)
downloadgnupg2-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.tar.xz
gnupg2-4fa261f8ecb16fabb4d06403f6ffacaa010ce453.zip
Fix possible system freeze on Mac OS X.
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog5
-rw-r--r--common/simple-pwquery.c6
-rw-r--r--common/sysutils.h3
3 files changed, 9 insertions, 5 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index 319b817a8..54ecd637f 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-19 Werner Koch <wk@g10code.com>
+
+ * simple-pwquery.c (agent_open): Use SUN_LEN
+ (JNLIB_NEED_AFLOCAL): Define and include mischelp.h.
+
2009-05-07 Werner Koch <wk@g10code.com>
* sexputil.c (get_rsa_pk_from_canon_sexp): New.
diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c
index 3a1f0365f..3598b3598 100644
--- a/common/simple-pwquery.c
+++ b/common/simple-pwquery.c
@@ -39,6 +39,9 @@
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
+
+#define JNLIB_NEED_AFLOCAL
+#include "../jnlib/mischelp.h"
#ifdef HAVE_W32_SYSTEM
#include "../jnlib/w32-afunix.h"
#endif
@@ -379,8 +382,7 @@ agent_open (int *rfd)
memset (&client_addr, 0, sizeof client_addr);
client_addr.sun_family = AF_UNIX;
strcpy (client_addr.sun_path, infostr);
- len = (offsetof (struct sockaddr_un, sun_path)
- + strlen(client_addr.sun_path) + 1);
+ len = SUN_LEN (&client_addr);
#ifdef HAVE_W32_SYSTEM
rc = _w32_sock_connect (fd, (struct sockaddr*)&client_addr, len );
diff --git a/common/sysutils.h b/common/sysutils.h
index de1e3bb1e..fd4340f3d 100644
--- a/common/sysutils.h
+++ b/common/sysutils.h
@@ -56,7 +56,4 @@ void gnupg_allow_set_foregound_window (pid_t pid);
#endif /*HAVE_W32_SYSTEM*/
-
-
-
#endif /*GNUPG_COMMON_SYSUTILS_H*/