From: Kurt Zeilenga Date: Mon, 7 Oct 2002 21:01:47 +0000 (+0000) Subject: s/256/LBER_ELEMENT_SIZEOF/ X-Git-Tag: NO_SLAP_OP_BLOCKS~921 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a17376dfd7521743a19d7ed58a98cc81d27ee38;p=openldap s/256/LBER_ELEMENT_SIZEOF/ set LBER_ELEMENT_SIZEOF to 256 maybe this should be set to N*sizeof(size_t) or something --- diff --git a/include/lber.h b/include/lber.h index ffa52b2bf8..aa952bd2c3 100644 --- a/include/lber.h +++ b/include/lber.h @@ -154,6 +154,7 @@ typedef struct lber_memory_fns { #define LBER_OPT_SUCCESS (0) #define LBER_OPT_ERROR (-1) +#define LBER_ELEMENT_SIZEOF (256) /* must be >= sizeof(BerElement) */ typedef struct berelement BerElement; typedef struct sockbuf Sockbuf; typedef struct seqorset Seqorset; diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index f45b974272..9d280d4296 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -95,7 +95,7 @@ int slap_passwd_parse( struct berval *reqdata, int rc = LDAP_SUCCESS; ber_tag_t tag; ber_len_t len; - char berbuf[256]; + char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; if( reqdata == NULL ) { @@ -236,7 +236,7 @@ struct berval * slap_passwd_return( { int rc; struct berval *bv = NULL; - char berbuf[256]; + char berbuf[LBER_ELEMENT_SIZEOF]; /* opaque structure, size unknown but smaller than berbuf */ BerElement *ber = (BerElement *)berbuf; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 2e772774cd..e23f9b4368 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -213,7 +213,7 @@ send_ldap_response( LDAPControl **ctrls ) { - char berbuf[256]; + char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; int rc; long bytes; @@ -655,7 +655,7 @@ send_search_entry( LDAPControl **ctrls ) { - char berbuf[256]; + char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; Attribute *a, *aa; int i, j, rc=-1, bytes; @@ -1197,7 +1197,7 @@ send_search_reference( BerVarray *v2refs ) { - char berbuf[256]; + char berbuf[LBER_ELEMENT_SIZEOF]; BerElement *ber = (BerElement *)berbuf; int rc; int bytes;