From: bert hubert Date: Fri, 4 Mar 2016 15:57:10 +0000 (+0100) Subject: when pre-parsing qname for gettag in lua, catch exception and set tag to 0 X-Git-Tag: rec-4.0.0-alpha2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2eacd67313a8c9f8cb882a1025a3bfed6556d99;p=pdns when pre-parsing qname for gettag in lua, catch exception and set tag to 0 --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3d56ab172..e0eda04b9 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1155,8 +1155,15 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr if(t_pdl->get() && (*t_pdl)->d_gettag) { unsigned int consumed=0; uint16_t qtype=0; - DNSName qname(question.c_str(), question.length(), sizeof(dnsheader), false, &qtype, 0, &consumed); - ctag=(*t_pdl)->gettag(fromaddr, destaddr, qname, qtype); + try { + DNSName qname(question.c_str(), question.length(), sizeof(dnsheader), false, &qtype, 0, &consumed); + ctag=(*t_pdl)->gettag(fromaddr, destaddr, qname, qtype); + } + catch(std::exception& e) + { + if(g_logCommonErrors) + L<getResponsePacket(ctag, question, g_now.tv_sec, &response, &age)) {