From: Apple Date: Mon, 23 Sep 2019 17:46:08 +0000 (+0000) Subject: libresolv-67.40.1.tar.gz X-Git-Tag: macos-10151^0 X-Git-Url: https://git.saurik.com/apple/libresolv.git/commitdiff_plain/HEAD libresolv-67.40.1.tar.gz --- diff --git a/ns_name.c b/ns_name.c index 07b0739..1c24833 100644 --- a/ns_name.c +++ b/ns_name.c @@ -638,7 +638,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) { const u_char *cp; u_int n; - int l; + int l = 0; cp = *ptrptr; while (cp < eom && (n = *cp++) != 0) { @@ -648,7 +648,7 @@ ns_name_skip(const u_char **ptrptr, const u_char *eom) cp += n; continue; case NS_TYPE_ELT: /* EDNS0 extended label */ - if ((l = labellen(cp - 1)) < 0) { + if (cp < eom && (l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /* XXX */ return(-1); }