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

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

Full_Name: Ralf Haferkamp
Version: HEAD
OS: LInux on IA64
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

At the top of the file the following struct is defined:

typedef struct {
    unsigned short bom;
    unsigned short cnt;
    union {
        unsigned long bytes;
        unsigned short len[2];
    } size;
} _ucheader_t;

The type "long" is however 8 bytes long on (most) 64Bit Archs. So the union
"size" make some trouble, when you access it through the len[] array.

One workaround could be to change the "long" to "uint32_t" which is available on
Linux but I am not sure how portable this is. Is there a "uint32_t" on BSD?

If I make this change slapd seems to work flawlessly. All test cases succeed.