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

[master] fix dyndb issues; isc_errno_toresult()

4445.	[cleanup]	isc_errno_toresult() can now be used to call the
			formerly private function isc__errno2result().
			[RT #43050]

4444.	[bug]		Fixed some issues related to dyndb: A bug caused
			braces to be omitted when passing configuration text
			from named.conf to a dyndb driver, and there was a
			use-after-free in the sample dyndb driver. [RT #43050]

Patch for dyndb driver submitted by Petr Spacek at Red Hat.
This commit is contained in:
Evan Hunt
2016-08-17 11:22:09 -07:00
parent 8c2c6b8b42
commit 3390d74e33
22 changed files with 308 additions and 67 deletions

View File

@@ -806,48 +806,46 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
if (c == '{') {
if (escaped) {
escaped = ISC_FALSE;
INSIST(prev != NULL);
*prev = '{';
} else {
lex->brace_count++;
}
} else if (c == '}') {
if (escaped) {
escaped = ISC_FALSE;
INSIST(prev != NULL);
*prev = '}';
break;
} else {
INSIST(lex->brace_count > 0);
lex->brace_count--;
}
INSIST(lex->brace_count > 0);
lex->brace_count--;
if (lex->brace_count > 0)
if (lex->brace_count == 0) {
tokenp->type = isc_tokentype_btext;
tokenp->value.as_textregion.base =
lex->data;
tokenp->value.as_textregion.length =
(unsigned int) (lex->max_token -
remaining);
no_comments = ISC_FALSE;
done = ISC_TRUE;
break;
tokenp->type = isc_tokentype_btext;
tokenp->value.as_textregion.base = lex->data;
tokenp->value.as_textregion.length =
(unsigned int) (lex->max_token -
remaining);
no_comments = ISC_FALSE;
done = ISC_TRUE;
} else {
if (c == '\\' && !escaped)
escaped = ISC_TRUE;
else
escaped = ISC_FALSE;
if (remaining == 0U) {
result = grow_data(lex, &remaining,
&curr, &prev);
if (result != ISC_R_SUCCESS)
goto done;
}
INSIST(remaining > 0U);
prev = curr;
*curr++ = c;
*curr = '\0';
remaining--;
}
if (c == '\\' && !escaped)
escaped = ISC_TRUE;
else
escaped = ISC_FALSE;
if (remaining == 0U) {
result = grow_data(lex, &remaining,
&curr, &prev);
if (result != ISC_R_SUCCESS)
goto done;
}
INSIST(remaining > 0U);
prev = curr;
*curr++ = c;
*curr = '\0';
remaining--;
break;
default:
FATAL_ERROR(__FILE__, __LINE__,