]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Don't choke on escaped content in getZoneCuts() 4807/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Dec 2016 15:27:14 +0000 (16:27 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 22 Dec 2016 09:35:29 +0000 (10:35 +0100)
commit0f707cd8e8d9c786b968f643a5f30f399918aaae
treefccb9dc83046ba51fc6c25d157b95acf78fdde2f
parent49077a201a5535a230fb7869f6d6e4b7c81bed0b
rec: Don't choke on escaped content in getZoneCuts()

`getZoneCuts()` was constructing a `DNSName` by passing a raw label returned
from `DNSName::getRawLabels()` as a string. The constructor then tried to handle
escaped characters from the string, resulting in a different `DNSName` than the
expected one. This caused the `qname != begin` condition to be false even after
every label in `labelsToAdd` had been added, causing an UB by calling
`std::vector::back()` on an empty vector.
Using `DNSName::prependRawLabel()` instead prevents this issue since the string is
not escaped.

(cherry picked from commit 754914f0177cd990db16ff0cc29c8789e94b32bb)
pdns/validate.cc