From 882bbaf6ac018fcd12bf40b15e29f6599e19ee40 Mon Sep 17 00:00:00 2001 From: Gil Date: Mon, 5 Feb 2024 21:41:27 -0800 Subject: [PATCH] Revert "alloc dynamically for rDNS names" This reverts commit d86a31a099c65cfd4a122fec82ba0f5c3c6954c0. This change does not seem to be correct. See discussion: https://github.com/wez/atomicparsley/issues/66#issuecomment-1928811013 The `12` was related to a fixed-size header and not related to the length of the variable-length rdns name. That length is encoded in the data part of the atom, in the call to `APar_atom_Binary_Put`. --- src/parsley.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parsley.cpp b/src/parsley.cpp index bfcf216..c1965ef 100644 --- a/src/parsley.cpp +++ b/src/parsley.cpp @@ -3499,15 +3499,15 @@ AtomicInfo *APar_reverseDNS_atom_Init(const char *rDNS_atom_name, APar_atom_Binary_Put( &parsedAtoms[rDNS_mean_atom], rDNS_domain, domain_len, 0); - uint32_t name_len = strlen(rDNS_atom_name); short rDNS_name_atom = APar_InterjectNewAtom("name", CHILD_ATOM, VERSIONED_ATOM, - name_len, + 12, AtomFlags_Data_Binary, 0, ilst_atom->AtomicLevel + 2, rDNS_mean_atom); + uint32_t name_len = strlen(rDNS_atom_name); parsedAtoms[rDNS_name_atom].ReverseDNSname = (char *)calloc(1, sizeof(char) * 101); memcpy(