* Tools/gdomap.c (init_iface): Round size to make sure we don't violate

pointer alignment boundaries.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21128 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2005-04-20 02:58:17 +00:00
parent c0c319001e
commit 684152e98e
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-04-19 Adam Fedor <fedor@gnu.org>
* Tools/gdomap.c (init_iface): Round size to make sure we don't violate
pointer alignment boundaries.
2005-04-14 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m: Add tweak to cope with buggy mailers

View file

@ -128,6 +128,10 @@
#define MAX_EXTRA ((GDO_NAME_MAX_LEN - 2 * IASIZE)/IASIZE)
#define ROUND(V, A) \
({ typeof(V) __v=(V); typeof(A) __a=(A); \
__a*((__v+__a-1)/__a); })
typedef unsigned char *uptr;
#ifndef __MINGW__
static int is_daemon = 0; /* Currently running as daemon. */
@ -1265,7 +1269,8 @@ init_iface()
{
ifreq = *(struct ifreq*)ifr_ptr;
#ifdef HAVE_SA_LEN
ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr) + ifreq.ifr_addr.sa_len;
ifr_ptr += sizeof(ifreq) - sizeof(ifreq.ifr_addr)
+ ROUND(ifreq.ifr_addr.sa_len, sizeof(struct ifreq*));
#else
ifr_ptr += sizeof(ifreq);
#endif