https://bugs.openldap.org/show_bug.cgi?id=9579
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to Konstantin Andreev from comment #0)
libraries/libldap/ldif.c:829
/* Squash \r\n to \n */ if ( len > 1 && line[len-2] == '\r' ) { len--; line[len-1] = '\n'; }
assumes “line” buffer has always been terminated by \n, and makes invalid transforms of these ends of file:
...X\r ~> ...X\r\n ...X\rY ~> ...X\n
Sounds like garbage in / garbage out. Any such ends of file are already invalid.