From: Ralf Haferkamp Date: Fri, 25 Sep 2009 15:08:37 +0000 (+0000) Subject: Throw an exception when reading an unexpected LDIF record type X-Git-Tag: ACLCHECK_0~215 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ad93ab595cab57494d9112af5e73e71153310d6c;p=openldap Throw an exception when reading an unexpected LDIF record type --- diff --git a/contrib/ldapc++/src/LdifReader.cpp b/contrib/ldapc++/src/LdifReader.cpp index d6dc1bcc4c..31cf76baa1 100644 --- a/contrib/ldapc++/src/LdifReader.cpp +++ b/contrib/ldapc++/src/LdifReader.cpp @@ -179,11 +179,12 @@ int LdifReader::readNextRecord( bool first ) LDAPEntry LdifReader::getEntryRecord() { + std::list::const_iterator i = m_currentRecord.begin(); if ( m_curRecType != LDAPMsg::SEARCH_ENTRY ) { - // Error + throw( std::runtime_error( "The LDIF record: '" + i->second + + "' is not a valid LDAP Entry" )); } - std::list::const_iterator i = m_currentRecord.begin(); LDAPEntry resEntry(i->second); i++; LDAPAttribute curAttr(i->first);