#define lutil_atoul(v, s) lutil_atoulx((v), (s), 10)
LDAP_LUTIL_F (int)
-lutil_str2bin( struct berval *in, struct berval *out );
+lutil_str2bin( struct berval *in, struct berval *out, void *ctx );
/* Parse and unparse time intervals */
LDAP_LUTIL_F (int)
#include "lutil.h"
#include "ldap_defaults.h"
#include "ldap_pvt.h"
+#include "lber_pvt.h"
#ifdef HAVE_EBCDIC
int _trans_argv = 1;
* any hex input.
*/
int
-lutil_str2bin( struct berval *in, struct berval *out )
+lutil_str2bin( struct berval *in, struct berval *out, void *ctx )
{
char *pin, *pout, ctmp;
char *end;
/* tmp must be at least as large as outbuf */
if ( out->bv_len > sizeof(tmpbuf)) {
- tmp = ber_memalloc( out->bv_len );
+ tmp = ber_memalloc_x( out->bv_len, ctx );
} else {
tmp = tmpbuf;
}
out->bv_len = num.len;
decfail:
if ( tmp != tmpbuf ) {
- ber_memfree( tmp );
+ ber_memfree_x( tmp, ctx );
}
}
return rc;
integerVal2Key(
struct berval val,
struct berval *key,
- struct berval itmp
+ struct berval itmp,
+ void *ctx
)
{
/* index format:
}
}
- if ( lutil_str2bin( &val, &itmp )) {
+ if ( lutil_str2bin( &val, &itmp, ctx )) {
return LDAP_INVALID_SYNTAX;
}
else if ( itmp.bv_len > maxstrlen )
itmp.bv_len = maxstrlen;
}
- rc = integerVal2Key( values[i], &keys[i], itmp );
+ rc = integerVal2Key( values[i], &keys[i], itmp, ctx );
if ( rc )
goto leave;
}
iv.bv_len = sizeof(ibuf);
}
- rc = integerVal2Key( *value, keys, iv );
+ rc = integerVal2Key( *value, keys, iv, ctx );
if ( rc == 0 )
*keysp = keys;
}
sn2.bv_val = stmp;
sn2.bv_len = sn.bv_len;
- if ( lutil_str2bin( &sn, &sn2 )) {
+ if ( lutil_str2bin( &sn, &sn2, ctx )) {
rc = LDAP_INVALID_SYNTAX;
goto leave;
}