]> git.ipfire.org Git - thirdparty/pdns.git/commit
Ensure a valid range to string() in PacketReader::getUnquotedText() 7813/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 10 May 2019 16:04:38 +0000 (18:04 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 May 2019 12:21:26 +0000 (14:21 +0200)
commitd7bbbcf4d84eaf359dc7d10dc36140666755bb9a
tree9eed8d76b4029f19dad34668d5a3625e5bdb121b
parent9b8a3ae04d2197d91e30c0f42e8566929fc2bc3e
Ensure a valid range to string() in PacketReader::getUnquotedText()

In some cases we might have called:

string::string(InputIt first, InputIt last)

with last < first, which is invalid.

libstdc++ handles that gracefully by throwing an out-of-range exception
but libc++ tries to allocate a negative value of bytes, which in turns
triggers a request for a very large memory allocation, which fails.
pdns/dnsparser.cc