From: Howard Chu Date: Fri, 10 Feb 2006 00:31:17 +0000 (+0000) Subject: ITS#4394 fix segfault X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~209 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0cc7ed6d550418bb0d936a557e3b9f119ba54a44;p=openldap ITS#4394 fix segfault --- diff --git a/servers/slapd/overlays/auditlog.c b/servers/slapd/overlays/auditlog.c index 441df6c68f..c617bb02ba 100644 --- a/servers/slapd/overlays/auditlog.c +++ b/servers/slapd/overlays/auditlog.c @@ -36,7 +36,7 @@ typedef struct auditlog_data { char *ad_logfile; } auditlog_data; -int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) { +static int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) { char *s; if((s = ldif_put(LDIF_PUT_VALUE, name, val, len)) == NULL) return(-1); @@ -45,7 +45,7 @@ int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) { return(0); } -int auditlog_response(Operation *op, SlapReply *rs) { +static int auditlog_response(Operation *op, SlapReply *rs) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; auditlog_data *ad = on->on_bi.bi_private; FILE *f; @@ -78,7 +78,9 @@ int auditlog_response(Operation *op, SlapReply *rs) { case LDAP_REQ_MODIFY: what = "modify"; for(m = op->orm_modlist; m; m = m->sml_next) - if( m->sml_desc == slap_schema.si_ad_modifiersName ) { + if( m->sml_desc == slap_schema.si_ad_modifiersName && + ( m->sml_op == LDAP_MOD_ADD || + m->sml_op == LDAP_MOD_REPLACE )) { who = m->sml_values[0].bv_val; break; }