glibc/0032-hesiod-Avoid-heap-overflow-in-get_txt_records-BZ-200.patch
Dominique Leuenberger 043c4769d6 Accepting request 394999 from Base:System
- Import patches from 2.23 branch (forwarded request 394998 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/394999
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=202
2016-05-19 10:02:35 +00:00

20 lines
602 B
Diff

2016-05-02 Florian Weimer <fweimer@redhat.com>
[BZ #20031]
* hesiod/hesiod.c (get_txt_records): Return error if TXT record is
completely empty.
Index: glibc-2.23/hesiod/hesiod.c
===================================================================
--- glibc-2.23.orig/hesiod/hesiod.c
+++ glibc-2.23/hesiod/hesiod.c
@@ -411,7 +411,7 @@ get_txt_records(struct hesiod_p *ctx, in
cp += INT16SZ + INT32SZ; /* skip the ttl, too */
rr.dlen = ns_get16(cp);
cp += INT16SZ;
- if (cp + rr.dlen > eom) {
+ if (rr.dlen == 0 || cp + rr.dlen > eom) {
__set_errno(EMSGSIZE);
goto cleanup;
}