diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-11 17:38:39 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-11 17:38:39 +0000 |
commit | 12ec26c3cb5babedffca6591101855375a55fcaf (patch) | |
tree | 01cef7964900d8c8a54cfeb467c184c77360ade9 | |
parent | 328d1b448a782e9544004990cad7aaaaae58d364 (diff) | |
parent | cb60a133060983d920eecf01542bad66236f6924 (diff) | |
download | dnsmasq-oreo-r2-release.tar.gz |
Merge cherrypicks of [2877873, 2877351, 2877352, 2877353, 2877568, 2877569, 2877069, 2877070, 2877071, 2877072, 2877874, 2877875, 2877876, 2877877, 2877878, 2877570, 2877571, 2877843, 2877844] into oc-r2-releaseandroid-8.0.0_r29oreo-r2-release
Change-Id: I095304d690f7d1d497cedd8c9eb4994bb67a81f8
-rwxr-xr-x | src/rfc1035.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rfc1035.c b/src/rfc1035.c index 8ae0bfa..e440e8a 100755 --- a/src/rfc1035.c +++ b/src/rfc1035.c @@ -48,7 +48,7 @@ static int extract_name(HEADER *header, size_t plen, unsigned char **pp, /* end marker */ { /* check that there are the correct no of bytes after the name */ - if (!CHECK_LEN(header, p, plen, extrabytes)) + if (!CHECK_LEN(header, p1 ? p1 : p, plen, extrabytes)) return 0; if (isExtract) @@ -1142,6 +1142,9 @@ size_t answer_request(HEADER *header, char *limit, size_t qlen, struct crec *crecp; int nxdomain = 0, auth = 1, trunc = 0; struct mx_srv_record *rec; + + // Make sure we do not underflow here too. + if (qlen > (size_t)(limit - ((char *)header))) return 0; /* If there is an RFC2671 pseudoheader then it will be overwritten by partial replies, so we have to do a dry run to see if we can answer |