From cf2a17657eb441eef3b71b1ac30e56c6ae621cda Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Sun, 28 Jan 2001 02:12:51 +0000 Subject: BIND 4.9.8-REL merge --- usr.sbin/named/libresolv/res_comp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'usr.sbin/named/libresolv') diff --git a/usr.sbin/named/libresolv/res_comp.c b/usr.sbin/named/libresolv/res_comp.c index d9b7d3323eb..132f99f3b55 100644 --- a/usr.sbin/named/libresolv/res_comp.c +++ b/usr.sbin/named/libresolv/res_comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_comp.c,v 1.3 1998/05/22 07:09:08 millert Exp $ */ +/* $OpenBSD: res_comp.c,v 1.4 2001/01/28 02:12:49 niklas Exp $ */ /* * ++Copyright++ 1985, 1993 @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_comp.c,v 8.14 1998/05/11 04:19:47 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_comp.c,v 1.3 1998/05/22 07:09:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: res_comp.c,v 1.4 2001/01/28 02:12:49 niklas Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -803,6 +803,25 @@ ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr) return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr)); } +/* + * Reset dnptrs so that there are no active references to pointers at or + * after src. + */ +void +ns_name_rollback(src, dnptrs, lastdnptr) + const u_char *src; + const u_char **dnptrs; + const u_char **lastdnptr; +{ + while (dnptrs < lastdnptr && *dnptrs != NULL) { + if (*dnptrs >= src) { + *dnptrs = NULL; + break; + } + dnptrs++; + } +} + /* * ns_name_skip(ptrptr, eom) * Advance *ptrptr to skip over the compressed name it points at. -- cgit v1.2.3