Commit f59c311c authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2656] Include bad data in the exception message

parent 10833250
......@@ -75,19 +75,19 @@ SRV::SRV(const std::string& srv_str) :
uint32_t num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV priority");
isc_throw(InvalidRdataText, "Invalid SRV priority in: " << srv_str);
}
const uint16_t priority = static_cast<uint16_t>(num);
num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV weight");
isc_throw(InvalidRdataText, "Invalid SRV weight in: " << srv_str);
}
const uint16_t weight = static_cast<uint16_t>(num);
num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV port");
isc_throw(InvalidRdataText, "Invalid SRV port in: " << srv_str);
}
const uint16_t port = static_cast<uint16_t>(num);
......@@ -158,19 +158,19 @@ SRV::SRV(MasterLexer& lexer, const Name* origin,
{
uint32_t num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV priority");
isc_throw(InvalidRdataText, "Invalid SRV priority: " << num);
}
const uint16_t priority = static_cast<uint16_t>(num);
num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV weight");
isc_throw(InvalidRdataText, "Invalid SRV weight: " << num);
}
const uint16_t weight = static_cast<uint16_t>(num);
num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
isc_throw(InvalidRdataText, "Invalid SRV port");
isc_throw(InvalidRdataText, "Invalid SRV port: " << num);
}
const uint16_t port = static_cast<uint16_t>(num);
......
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