mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-09 02:58:18 -04:00
fix: dev: fix the error handling of put_yamlstr calls
The return value was sometimes being ignored when it shouldn't have been. Closes #5301 Merge branch '5301-cid-550216-remove-dead-code' into 'main' See merge request isc-projects/bind9!10432
This commit is contained in:
commit
fad97e3cd1
1 changed files with 12 additions and 11 deletions
|
|
@ -102,6 +102,13 @@ hexdump(const char *msg, const char *msg2, void *base, size_t len) {
|
|||
} else \
|
||||
isc_buffer_putstr(b, s); \
|
||||
}
|
||||
#define PUT_YAMLSTR(target, namebuf, len, utfok) \
|
||||
{ \
|
||||
result = put_yamlstr(target, namebuf, len, utfok); \
|
||||
if (result != ISC_R_SUCCESS) { \
|
||||
goto cleanup; \
|
||||
} \
|
||||
}
|
||||
#define VALID_NAMED_PSEUDOSECTION(s) \
|
||||
(((s) > DNS_PSEUDOSECTION_ANY) && ((s) < DNS_PSEUDOSECTION_MAX))
|
||||
#define VALID_PSEUDOSECTION(s) \
|
||||
|
|
@ -3500,11 +3507,8 @@ render_nameopt(isc_buffer_t *optbuf, bool yaml, isc_buffer_t *target) {
|
|||
dns_name_format(name, namebuf, sizeof(namebuf));
|
||||
ADD_STRING(target, " \"");
|
||||
if (yaml) {
|
||||
result = put_yamlstr(target, (unsigned char *)namebuf,
|
||||
strlen(namebuf), false);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
PUT_YAMLSTR(target, (unsigned char *)namebuf,
|
||||
strlen(namebuf), false);
|
||||
} else {
|
||||
ADD_STRING(target, namebuf);
|
||||
}
|
||||
|
|
@ -3574,11 +3578,8 @@ render_zoneversion(dns_message_t *msg, isc_buffer_t *optbuf,
|
|||
ADD_STRING(target, "ZONE: ");
|
||||
if (yaml) {
|
||||
ADD_STRING(target, "\"");
|
||||
put_yamlstr(target, (unsigned char *)namebuf,
|
||||
PUT_YAMLSTR(target, (unsigned char *)namebuf,
|
||||
strlen(namebuf), false);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
ADD_STRING(target, "\"");
|
||||
} else {
|
||||
ADD_STRING(target, namebuf);
|
||||
|
|
@ -3610,7 +3611,7 @@ render_zoneversion(dns_message_t *msg, isc_buffer_t *optbuf,
|
|||
ADD_STRING(target, sep2);
|
||||
INDENT(style);
|
||||
ADD_STRING(target, "PVALUE: \"");
|
||||
put_yamlstr(target, data, len, false);
|
||||
PUT_YAMLSTR(target, data, len, false);
|
||||
ADD_STRING(target, "\"");
|
||||
} else {
|
||||
ADD_STRING(target, " (\"");
|
||||
|
|
@ -4030,7 +4031,7 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section,
|
|||
} else {
|
||||
ADD_STRING(target, "\"");
|
||||
}
|
||||
put_yamlstr(target, optdata, optlen, utf8ok);
|
||||
PUT_YAMLSTR(target, optdata, optlen, utf8ok);
|
||||
if (!extra_text) {
|
||||
ADD_STRING(target, "\")");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue