Not happening here:
Your patch is invalid, but it appears there was a bug in the underlying back-ldif code. Still, it did not result in a SEGV. back-ldif is now fixed in master.
e1ccebcf indeed fixes the problem. (I can see the SEGV when started via gdb.)
Thanks.
Jan