From: Howard Chu Date: Sat, 1 Dec 2007 20:28:18 +0000 (+0000) Subject: Fix tmpbuf size X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~366 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=34a503960d1557984197300204b6fa39a8104923;p=openldap Fix tmpbuf size --- diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index 9dd853468d..f14e6c877d 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -745,8 +745,9 @@ lutil_str2bin( struct berval *in, struct berval *out ) #define DECMAX 8 /* 8 digits at a time */ - if ( len >= sizeof(tmpbuf)) { - tmp = ber_memalloc( len+1 ); + /* tmp must be at least as large as outbuf */ + if ( out->bv_len > sizeof(tmpbuf)) { + tmp = ber_memalloc( out->bv_len ); } else { tmp = tmpbuf; }