Merge tag 'LA.UM.5.8.r1-02900-8x98.0' into int/n/fp2
"LA.UM.5.8.r1-02900-8x98.0"
* tag 'LA.UM.5.8.r1-02900-8x98.0':
dnsmasq: dnsmasq should not die if interface not found
Issue: FP2N-105
Change-Id: Ia39a63897c03d64de9b979d763cfd78718734950
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 @@
/* 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 @@
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