[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: 64bit issue in libraries/liblunicode/ucdata/ucdata.c causes slapd to dump core (ITS#1960)



These patches cause segfaults in ucdata on slapd startup on OS/390. I think
there are
several places in the code using "unsigned short" etc. instead of the
matching type from the struct definitions.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of Kurt@OpenLDAP.org
> Sent: Thursday, July 25, 2002 5:46 AM
> To: openldap-its@OpenLDAP.org
> Subject: Re: 64bit issue in libraries/liblunicode/ucdata/ucdata.c causes
> slapd to dump core (ITS#1960)
>
>
> Thanks.
>
> I'll commit this as yet another hack.  As I noted
> previously, use of fixed sized types limits the
> portability of the code (not all platforms will
> have an integer type of the needed size).
>
> Kurt
>
> At 05:27 AM 2002-07-25, rhafer@suse.de wrote:
>
> >--DocE+STaALJfprDB
> >Content-Type: text/plain; charset=us-ascii
> >Content-Disposition: inline
> >
> >Ok, thanks. I just tested a bit more, and stumbled over some other
> >occurences of the problem. The attached patch should fix these.
> It seems to
> >work properly. At least on the architectures I could get my hands on.
> >Though there still seem to be problems on the client side. I will
> look into
> >those next.
> >
> >
> >On Tue, Jul 23, 2002 at 05:02:43PM +0000, Kurt D. Zeilenga wrote:
> >> At 08:28 AM 2002-07-23, rhafer@suse.de wrote:
> >> >Did you really commit something? I didn't see any changes to
> liblunicode
> >> >recently.
> >>
> >> It's NOW committed.
> >>
> >>
> >--
> >Ralf
> >
> >--DocE+STaALJfprDB
> >Content-Type: text/plain; charset=us-ascii
> >Content-Disposition: attachment; filename="uc_data.dif"
> >
> >? contrib/ldapc++/depcomp
> >? contrib/ldapc++/src/LDAPSaslBindRequest.cpp
> >? contrib/ldapc++/src/LDAPSaslBindRequest.h
> >? contrib/ldapc++/src/SASLCallbackHandler.h
> >? contrib/ldapc++/src/SASLInteraction.h
> >? contrib/ldapc++/src/SaslCallbackHandler.h
> >Index: libraries/liblunicode/ucdata/ucdata.c
> >===================================================================
> >RCS file: /repo/OpenLDAP/pkg/ldap/libraries/liblunicode/ucdata/ucdata.c,v
> >retrieving revision 1.18
> >diff -u -r1.18 ucdata.c
> >--- libraries/liblunicode/ucdata/ucdata.c       23 Jul 2002
> 16:22:58 -0000      1.18
> >+++ libraries/liblunicode/ucdata/ucdata.c       25 Jul 2002 12:19:33 -0000
> >@@ -45,8 +45,8 @@
> >
> **************************************************************************/
> >
> > typedef struct {
> >-    ac_uint4 bom;
> >-    ac_uint4 cnt;
> >+    ac_uint2 bom;
> >+    ac_uint2 cnt;
> >     union {
> >         ac_uint4 bytes;
> >         ac_uint2 len[2];
> >Index: libraries/liblunicode/ucdata/ucgendat.c
> >===================================================================
> >RCS file:
> /repo/OpenLDAP/pkg/ldap/libraries/liblunicode/ucdata/ucgendat.c,v
> >retrieving revision 1.20
> >diff -u -r1.20 ucgendat.c
> >--- libraries/liblunicode/ucdata/ucgendat.c     23 Jul 2002
> 16:41:30 -0000      1.20
> >+++ libraries/liblunicode/ucdata/ucgendat.c     25 Jul 2002 12:19:33 -0000
> >@@ -30,6 +30,7 @@
> > #include "ldap_config.h"
> >
> > #include <stdio.h>
> >+#include <ac/bytes.h>
> > #include <ac/stdlib.h>
> > #include <ac/string.h>
> > #include <ac/unistd.h>
> >@@ -1216,7 +1217,8 @@
> > write_cdata(char *opath)
> > {
> >     FILE *out;
> >-    unsigned long i, idx, bytes, nprops;
> >+    unsigned long i, idx, nprops;
> >+    ac_uint4 bytes;
> >     unsigned short casecnt[2];
> >     char path[BUFSIZ];
> >
> >@@ -1273,7 +1275,7 @@
> >     /*
> >      * Write the byte count.
> >      */
> >-    fwrite((char *) &bytes, sizeof(unsigned long), 1, out);
> >+    fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
> >
> >     /*
> >      * Write the property list counts.
> >
> >--DocE+STaALJfprDB--
>