From: Howard Chu Date: Thu, 10 Jan 2002 20:25:23 +0000 (+0000) Subject: Fix str2anlist declaration, str is not const. (gets overwritten if X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~202 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=54dae3d3d3104e58d54da9369d7ec2e099f9c32b;p=openldap Fix str2anlist declaration, str is not const. (gets overwritten if there is an error.) --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 4c7efe97f2..75193d9381 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -435,7 +435,7 @@ an_find( * to an existing list if it was given. */ AttributeName * -str2anlist( AttributeName *an, const char *in, const char *brkstr ) +str2anlist( AttributeName *an, char *in, const char *brkstr ) { char *str; char *s; @@ -473,7 +473,7 @@ str2anlist( AttributeName *an, const char *in, const char *brkstr ) if ( !anew->an_oc ) { free( an ); /* overwrites input string on error! */ - strcpy( (char *)in, s ); + strcpy( in, s ); return NULL; } } diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 1cbf8fc314..2495083af4 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -54,7 +54,7 @@ LDAP_SLAPD_F (AttributeDescription *) ad_find_lang LDAP_P(( struct berval *lang )); LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an, - const char *str, const char *brkstr )); + char *str, const char *brkstr )); LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s )); /*