+3785. [bug] Debugging code dumphex didn't accept arbitarily long
+ input (only compiled with -DDEBUG). [RT #35544]
+
3784. [bug] Using "rrset-order fixed" when it had not been
enabled at compile time caused inconsistent
results. It now works as documented, defaulting
static void
hexdump(const char *desc, unsigned char *data, size_t size) {
- char hexdump[BUFSIZ];
+ char hexdump[BUFSIZ * 2 + 1];
isc_buffer_t b;
isc_region_t r;
+ isc_result_t result;
+ size_t bytes;
- isc_buffer_init(&b, hexdump, sizeof(hexdump));
- r.base = data;
- r.length = size;
- isc_hex_totext(&r, 0, "", &b);
- isc_buffer_putuint8(&b, 0);
- fprintf(stderr, "%s: %s\n", desc, hexdump);
+ fprintf(stderr, "%s: ", desc);
+ do {
+ isc_buffer_init(&b, hexdump, sizeof(hexdump));
+ r.base = data;
+ r.length = bytes = (size > BUFSIZ) ? BUFSIZ : size;
+ result = isc_hex_totext(&r, 0, "", &b);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ isc_buffer_putuint8(&b, 0);
+ fprintf(stderr, "%s", hexdump);
+ data += bytes;
+ size -= bytes;
+ } while (size > 0);
+ fprintf(stderr, "\n");
}
#endif
isc_crc64_final(&crc);
#ifdef DEBUG
- hexdump("serializing CRC", &crc, sizeof(crc));
+ hexdump("serializing CRC", (unsigned char *)&crc, sizeof(crc));
#endif
/* Serialize header */
isc_crc64_final(&crc);
#ifdef DEBUG
- hexdump("deserializing CRC", &crc, sizeof(crc));
+ hexdump("deserializing CRC", (unsigned char *)&crc, sizeof(crc));
#endif
/* Check file hash */
#ifdef DEBUG
static void
hexdump(const char *desc, unsigned char *data, size_t size) {
- char hexdump[BUFSIZ];
+ char hexdump[BUFSIZ * 2 + 1];
isc_buffer_t b;
isc_region_t r;
+ isc_result_t result;
+ size_t bytes;
- isc_buffer_init(&b, hexdump, sizeof(hexdump));
- r.base = data;
- r.length = size;
- isc_hex_totext(&r, 0, "", &b);
- isc_buffer_putuint8(&b, 0);
- fprintf(stderr, "%s: %s\n", desc, hexdump);
+ fprintf(stderr, "%s: ", desc);
+ do {
+ isc_buffer_init(&b, hexdump, sizeof(hexdump));
+ r.base = data;
+ r.length = bytes = (size > BUFSIZ) ? BUFSIZ : size;
+ result = isc_hex_totext(&r, 0, "", &b);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ isc_buffer_putuint8(&b, 0);
+ fprintf(stderr, "%s", hexdump);
+ data += bytes;
+ size -= bytes;
+ } while (size > 0);
+ fprintf(stderr, "\n");
}
#endif