Fix tmpbuf size

This commit is contained in:
Howard Chu 2007-12-01 20:28:18 +00:00
parent 6ffbb9b04d
commit 34a503960d

View File

@ -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;
}