]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup (coverity)
authorHoward Chu <hyc@openldap.org>
Wed, 14 Jan 2015 12:16:24 +0000 (12:16 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 19 Jan 2015 19:45:55 +0000 (13:45 -0600)
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 );