Commit 0be210a2 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2383] Check the constructor gets some data

It is invalid input if no data is passed.
parent 8d2205ed
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment