From: Michal 'vorner' Vaner Date: Tue, 30 Oct 2012 11:23:10 +0000 (+0100) Subject: [2383] Check the constructor gets some data X-Git-Tag: trac2487_base~21^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0be210a2f53811e07a7ff0aad0aa388c3ef6048c;p=thirdparty%2Fkea.git [2383] Check the constructor gets some data It is invalid input if no data is passed. --- diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc index fdb4ea4e13..733b52bb59 100644 --- a/src/lib/dns/name.cc +++ b/src/lib/dns/name.cc @@ -322,6 +322,11 @@ Name::Name(const std::string &namestring, bool downcase) { } Name::Name(const char* namedata, size_t data_len, const Name*, bool downcase) { + // Check validity of data + if (namedata == NULL || data_len == 0) { + isc_throw(isc::InvalidParameter, + "No data provided to Name constructor"); + } // Prepare inputs for the parser const char* end = namedata + data_len;