Segfault in parsing DNS names
It seems it is illegal for this
to be NULL
and the compiler is allowed to optimize the check out from inside the function.
55 Name ParsedName::toOwned() const {
56 Name result;
57 const ParsedName *label = this;
58 while (label) {
59 result.labels_.emplace_back(label->label_.begin(), label->label_.end());
60 /*
61 * Convert the from the shared_ptr to a raw pointer (more
62 * convenient for local manipulation and without performance
63 * penalties for all the atomic reference counters).
(gdb) print label
$3 = (const Pakon::DNS::ParsedName *) 0x0
The segfault happens on line 59, directly below the check.