From 0a12ea91df819fe6e4b9273060826c5d2c0186b4 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 2 Jan 2011 15:58:48 +0000 Subject: [PATCH] hex digits need to be in pairs (ITS#6652) --- servers/slapd/overlays/accesslog.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index af35ac1332..8522c5e4a4 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -1051,6 +1051,8 @@ logSchemaControlValidate( /* extract and check controlValue */ if ( strncasecmp( &val.bv_val[ i ], "controlValue ", STRLENOF( "controlValue " ) ) == 0 ) { + ber_len_t valueStart, valueLen; + i += STRLENOF( "controlValue " ); for ( ; i < val.bv_len; i++ ) { if ( !ASCII_SPACE( val.bv_val[ i ] ) ) { @@ -1066,7 +1068,10 @@ logSchemaControlValidate( return LDAP_INVALID_SYNTAX; } - for ( i++; i < val.bv_len; i++ ) { + i++; + valueStart = i; + + for ( ; i < val.bv_len; i++ ) { if ( val.bv_val[ i ] == '"' ) { break; } @@ -1080,6 +1085,11 @@ logSchemaControlValidate( return LDAP_INVALID_SYNTAX; } + valueLen = i - valueStart; + if ( (valueLen/2)*2 != valueLen ) { + return LDAP_INVALID_SYNTAX; + } + for ( i++; i < val.bv_len; i++ ) { if ( !ASCII_SPACE( val.bv_val[ i ] ) ) { break; -- 2.39.5