]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-passwd/search.c
Minor cleanup (coverity)
[openldap] / servers / slapd / back-passwd / search.c
index 60ffd1b5b823ba3aa4ff4b910da29dd14b1422c1..490637b192a91bda3d85b6613088a9711d6a764c 100644 (file)
@@ -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 );