2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

make dns_name_fromtext fail when passed an empty string, not assert.

This commit is contained in:
Brian Wellington
2001-01-22 03:30:27 +00:00
parent e8af4e1524
commit 9427d22299
2 changed files with 4 additions and 5 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: name.h,v 1.87 2001/01/09 21:53:04 bwelling Exp $ */ /* $Id: name.h,v 1.88 2001/01/22 03:30:27 bwelling Exp $ */
#ifndef DNS_NAME_H #ifndef DNS_NAME_H
#define DNS_NAME_H 1 #define DNS_NAME_H 1
@@ -830,8 +830,8 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
* *
* 'name' is a valid name. * 'name' is a valid name.
* *
* 'source' is a valid buffer with a current pointer before its * 'source' is a valid buffer with a current pointer before or at the
* used pointer. * same place as its used pointer.
* *
* 'target' is a valid buffer or 'target' is NULL and 'name' has * 'target' is a valid buffer or 'target' is NULL and 'name' has
* a dedicated buffer. * a dedicated buffer.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: name.c,v 1.117 2001/01/11 21:07:20 gson Exp $ */ /* $Id: name.c,v 1.118 2001/01/22 03:30:26 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -1111,7 +1111,6 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
REQUIRE(VALID_NAME(name)); REQUIRE(VALID_NAME(name));
REQUIRE(ISC_BUFFER_VALID(source)); REQUIRE(ISC_BUFFER_VALID(source));
REQUIRE(isc_buffer_current(source) < isc_buffer_used(source));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) || REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && name->buffer != NULL)); (target == NULL && name->buffer != NULL));