Module Name: src Committed By: yamt Date: Thu May 22 15:45:50 UTC 2014
Modified Files: src/external/bsd/libbind/dist/nameser [yamt-pagecache]: ns_name.c Log Message: sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") To generate a diff of this commit: cvs rdiff -u -r1.1.1.1.14.1 -r1.1.1.1.14.2 \ src/external/bsd/libbind/dist/nameser/ns_name.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/libbind/dist/nameser/ns_name.c diff -u src/external/bsd/libbind/dist/nameser/ns_name.c:1.1.1.1.14.1 src/external/bsd/libbind/dist/nameser/ns_name.c:1.1.1.1.14.2 --- src/external/bsd/libbind/dist/nameser/ns_name.c:1.1.1.1.14.1 Tue Oct 30 18:55:33 2012 +++ src/external/bsd/libbind/dist/nameser/ns_name.c Thu May 22 15:45:50 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ns_name.c,v 1.1.1.1.14.1 2012/10/30 18:55:33 yamt Exp $ */ +/* $NetBSD: ns_name.c,v 1.1.1.1.14.2 2014/05/22 15:45:50 yamt Exp $ */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -463,11 +463,13 @@ ns_name_unpack2(const u_char *msg, const } if (len < 0) len = srcp - src + 1; - srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff)); - if (srcp < msg || srcp >= eom) { /*%< Out of range. */ + + n = ((n & 0x3f) << 8) | (*srcp & 0xff); + if (n >= eom - msg) { /*%< Out of range. */ errno = EMSGSIZE; return (-1); } + srcp = msg + n; checked += 2; /* * Check for loops in the compressed name;