Commit 5362c159 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix "cn: \n" bug

parent 292961ad
......@@ -114,16 +114,10 @@ ldif_parse_line(
url = 0;
b64 = 0;
if ( *s == '\0' ) {
/* no value */
value = "";
vlen = 0;
goto done;
}
if ( *s == '<' ) {
s++;
url = 1;
} else if ( *s == ':' ) {
/* base 64 encoded value */
s++;
......@@ -142,20 +136,19 @@ ldif_parse_line(
}
*d = '\0';
/* if no value is present, error out */
if ( *s == '\0' ) {
ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
"ldif_parse_line: %s missing %svalue\n", type,
url ? "URL " : b64 ? "base64 " : "" );
value = NULL;
vlen = 0;
goto done;
}
if ( b64 ) {
char *byte = s;
value = s;
if ( *s == '\0' ) {
/* no value is present, error out */
ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
"ldif_parse_line: %s missing base64 value\n", type );
value = NULL;
vlen = 0;
goto done;
}
byte = value = s;
for ( p = s, vlen = 0; p < d; p += 4, vlen += 3 ) {
int i;
......@@ -199,6 +192,15 @@ ldif_parse_line(
s[ vlen ] = '\0';
} else if ( url ) {
if ( *s == '\0' ) {
/* no value is present, error out */
ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
"ldif_parse_line: %s missing URL value\n", type );
value = NULL;
vlen = 0;
goto done;
}
if( ldif_fetch_url( s, &value, &vlen ) ) {
ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
"ldif_parse_line: %s: URL \"%s\" fetch failed\n",
......@@ -218,6 +220,7 @@ done:
if( type == NULL ) {
ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
"ldif_parse_line: type malloc failed\n");
if( url ) ber_memfree( value );
ber_memfree( freeme );
return( -1 );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment