FoxIO-LLC / ja4

JA4+ is a suite of network fingerprinting standards
https://foxio.io
Other
774 stars 65 forks source link

Wireshark: allocate memory as zero-filled #127

Closed Boolean263 closed 1 week ago

Boolean263 commented 2 weeks ago

Initialize the insert_at member of newly created pkt_info_t items. Removes potential for segfault noted in #126.

Replace calls of wmem_alloc() with wmem_new0(). The 0 in the name is because this routine initializes the allocated memory with null bytes, so if members of data structures are added in the future but aren't fully initialized, they don't potentially dangle pointers. (This has the potential to reduce boilerplate for manually initializing structure members to zero, but that is left as-is for now to minimize patch size.)

The use of wmem_new0() also handles casting the returned memory to the right data type, although this is just a bonus here.

Closes #126