[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Parsing of *.conf files



JR Heisey writes:

> I have discovered a parsing error when a DN contains a value which
> contains a comma.

Thanks.  Fix committed to openldap-devel.

> I don't know much about the Unix tools. I have Cygnus's development
> tools but I don't see how to generate the diff output that I've seen
> posted to this list.

	diff -u2 old-file new-file
or	diff -c2 old-file new-file
or if you got the source from CVS,
	cvs diff { -u2 or -c2 } filename

The '2' means to output 2 lines of context around each change, which is
my personal preferrence.  The default is 3 lines.


>      case '\\':
>          SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1
> );
> +        next++; // skip by the escaped character
>          break;

It needs to check if \ is followed by a null character as well:

        case '\\':
-           SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
+           if ( next[1] ) {
+               SAFEMEMCPY( next, next + 1, strlen( next + 1 ) + 1 );
+               next++;         /* skip the escaped character */
+           }
            break;

-- 
Hallvard