summaryrefslogtreecommitdiffstats
path: root/freebsd/lib/libc/nameser/ns_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/lib/libc/nameser/ns_name.c')
-rw-r--r--freebsd/lib/libc/nameser/ns_name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/freebsd/lib/libc/nameser/ns_name.c b/freebsd/lib/libc/nameser/ns_name.c
index 50946fab..0e764359 100644
--- a/freebsd/lib/libc/nameser/ns_name.c
+++ b/freebsd/lib/libc/nameser/ns_name.c
@@ -686,7 +686,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) {
@@ -696,7 +696,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);
}