Fix stack overflow in write_record_aaaa

This commit is contained in:
Pieter Wuille 2020-10-19 16:32:08 -07:00
parent 63ff7e40c9
commit b1cf356ff2

View file

@ -180,7 +180,7 @@ int static write_record_aaaa(unsigned char** outpos, const unsigned char *outend
int error = 0;
int ret = write_record(outpos, outend, name, offset, TYPE_AAAA, cls, ttl);
if (ret) return ret;
if (outend - *outpos < 6) {
if (outend - *outpos < 18) {
error = -5;
} else {
// rdlength