[PATCH 1/4] support: Add resolv_response_set_buffer

Florian Weimer fweimer@redhat.com
Mon Aug 10 15:31:36 GMT 2026


* Adhemerval Zanella Netto:

>> +void
>> +resolv_response_set_buffer (struct resolv_response_builder *b,
>> +                            const unsigned char *data, size_t length)
>> +{
>> +  if (length > max_response_length)
>> +    FAIL_EXIT1 ("resolv_response_set_buffer: length %zu exceeds maximum %d",
>> +                length, max_response_length);
>> +  memmove (b->buffer, data, length);
>> +  b->offset = length;
>
> This does not update section, current_rdata_offset, or the
> compression_offsets so the resolv_response_builder is left in an
> inconsistent state. Maybe either document it or fail for subsequent
> resolv_response_add_data.

Right.  Section does not need updating, but the others need to be
handled in some way.  I'm going to send a v2.

Thanks,
Florian



More information about the Libc-alpha mailing list