From 2271fb463636428ff3941810794fce62ca28e703 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 26 Feb 2007 09:50:19 +0000 Subject: [PATCH] detect braindead entries (e.g. from back-perl, ITS#4845,ITS#4852) --- servers/slapd/entry.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index dda4e18502..7f1461d24f 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -166,6 +166,11 @@ str2entry2( char *s, int checkvals ) break; } i++; + if (i >= lines) { + Debug( LDAP_DEBUG_TRACE, + "<= str2entry ran past end of entry\n", 0, 0, 0 ); + goto fail; + } rc = ldif_parse_line2( s, type+i, vals+i, &freev ); freeval[i] = freev; -- 2.39.5