From 86d81fa1530098b7029fbff5d826c9567eb25125 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 14 Jan 2015 12:16:24 +0000 Subject: [PATCH] Minor cleanup (coverity) --- servers/slapd/back-passwd/search.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 60ffd1b5b8..490637b192 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -327,6 +327,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) */ if (pw->pw_gecos[0]) { char *s; + char buf[1024]; ber_str2bv( pw->pw_gecos, 0, 0, &val ); attr_merge_normalize_one( e, ad_desc, &val, NULL ); @@ -336,8 +337,6 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) s = ber_bvchr( &val, '&' ); if ( s ) { - char buf[1024]; - if( val.bv_len + pwlen < sizeof(buf) ) { int i = s - val.bv_val; strncpy( buf, val.bv_val, i ); -- 2.39.5