2022-12-06 17:16:06 +00:00
|
|
|
From 0e581ae7b2d3b181f22f71d5a0b7ace0bf90089f Mon Sep 17 00:00:00 2001
|
2017-10-03 11:53:42 +00:00
|
|
|
From: Doran Moppert <dmoppert@redhat.com>
|
|
|
|
Date: Tue, 26 Sep 2017 14:48:20 +0930
|
|
|
|
Subject: [PATCH] google patch hand-applied
|
|
|
|
|
|
|
|
---
|
|
|
|
src/edns0.c | 10 +++++-----
|
2020-03-03 19:15:05 +00:00
|
|
|
src/rfc1035.c | 3 +++
|
2022-09-27 13:35:46 +00:00
|
|
|
2 files changed, 8 insertions(+), 5 deletions(-)
|
2017-10-03 11:53:42 +00:00
|
|
|
|
|
|
|
diff --git a/src/edns0.c b/src/edns0.c
|
2022-09-27 13:35:46 +00:00
|
|
|
index c498eb1..0eb3873 100644
|
2017-10-03 11:53:42 +00:00
|
|
|
--- a/src/edns0.c
|
|
|
|
+++ b/src/edns0.c
|
|
|
|
@@ -212,11 +212,11 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l
|
|
|
|
/* Copy back any options */
|
|
|
|
if (buff)
|
|
|
|
{
|
|
|
|
- if (p + rdlen > limit)
|
|
|
|
- {
|
|
|
|
- free(buff);
|
|
|
|
- return plen; /* Too big */
|
|
|
|
- }
|
|
|
|
+ if (p + rdlen > limit)
|
|
|
|
+ {
|
|
|
|
+ free(buff);
|
|
|
|
+ return plen; /* Too big */
|
|
|
|
+ }
|
|
|
|
memcpy(p, buff, rdlen);
|
|
|
|
free(buff);
|
|
|
|
p += rdlen;
|
|
|
|
diff --git a/src/rfc1035.c b/src/rfc1035.c
|
2022-12-06 17:16:06 +00:00
|
|
|
index 5c0df56..7e01459 100644
|
2017-10-03 11:53:42 +00:00
|
|
|
--- a/src/rfc1035.c
|
|
|
|
+++ b/src/rfc1035.c
|
2022-12-06 17:16:06 +00:00
|
|
|
@@ -1425,6 +1425,9 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
2017-10-03 11:53:42 +00:00
|
|
|
size_t len;
|
2020-03-03 19:15:05 +00:00
|
|
|
int rd_bit = (header->hb3 & HB3_RD);
|
|
|
|
|
2017-10-03 11:53:42 +00:00
|
|
|
+ // Make sure we do not underflow here too.
|
|
|
|
+ if (qlen > (limit - ((char *)header))) return 0;
|
2020-03-03 19:15:05 +00:00
|
|
|
+
|
2022-12-06 17:16:06 +00:00
|
|
|
if (stale)
|
|
|
|
*stale = 0;
|
|
|
|
|
2017-10-03 11:53:42 +00:00
|
|
|
--
|
2022-12-06 17:16:06 +00:00
|
|
|
2.38.1
|
2017-10-03 11:53:42 +00:00
|
|
|
|