]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9578 ldif: terminate buf after truncating \r
authorKonstantin Andreev <grapvar@gmail.com>
Sat, 12 Jun 2021 11:41:44 +0000 (11:41 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 12 Jun 2021 14:08:11 +0000 (15:08 +0100)
libraries/libldap/ldif.c

index 8e84a898d8a430f27af3167d0aec6f8367f17d8e..767d7ec50e354972b0417449c23642111b8a704e 100644 (file)
@@ -829,6 +829,7 @@ ldif_read_record(
                /* Squash \r\n to \n */
                if ( len > 1 && line[len-2] == '\r' ) {
                        len--;
+                       line[len]   = '\0';
                        line[len-1] = '\n';
                }