2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 13:08:06 +00:00

The bits in the last byte of a bitstring being constructed in _fromtext()

were not always shifted into the correct positions.  This would cause
an error when certain valid bitstrings, e.g. "\[xA/4].", were parsed.
This commit is contained in:
Bob Halley 1999-08-19 17:56:35 +00:00
parent 77a3409a66
commit c3e95f11e0

View File

@ -1315,6 +1315,12 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
if (tbcount == 0)
return (DNS_R_BADBITSTRING);
if (count > 0) {
n1 = count % 8;
if (n1 != 0)
value <<= (8 - n1);
}
if (bitlength != 0) {
if (bitlength > tbcount)
return (DNS_R_BADBITSTRING);
@ -1412,9 +1418,6 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
bitlength = tbcount;
if (count > 0) {
n1 = count % 8;
if (n1 != 0)
value <<= (8 - n1);
*ndata++ = value;
nrem--;
nused++;