From 54dae3d3d3104e58d54da9369d7ec2e099f9c32b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 10 Jan 2002 20:25:23 +0000 Subject: [PATCH] Fix str2anlist declaration, str is not const. (gets overwritten if there is an error.) --- servers/slapd/ad.c | 4 ++-- servers/slapd/proto-slap.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 )); /*