]> git.saurik.com Git - apple/libresolv.git/commitdiff
libresolv-67.40.1.tar.gz master macos-10151 macos-10152 macos-10153 macos-10154 macos-10155 macos-10156 macos-1101 v67.40.1 v68
authorApple <opensource@apple.com>
Mon, 23 Sep 2019 17:46:08 +0000 (17:46 +0000)
committerApple <opensource@apple.com>
Mon, 23 Sep 2019 17:46:08 +0000 (17:46 +0000)
ns_name.c

index 07b073994ebc318e28055a26edbbfdace98a131e..1c248337de46bb6f0a225b1d4f88e4ceb682ec09 100644 (file)
--- 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;
 {
        const u_char *cp;
        u_int n;
-       int l;
+       int l = 0;
 
        cp = *ptrptr;
        while (cp < eom && (n = *cp++) != 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 */
                        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);
                        }
                                errno = EMSGSIZE; /* XXX */
                                return(-1);
                        }