spamhaus / rbldnsd

A small and fast DNS daemon especially made to serve DNSBL zones.
https://rbldnsd.io/
GNU General Public License v2.0
57 stars 12 forks source link

configure,rbldnsd.c: replace mallinfo() with mallinfo2() #30

Open orlitzky opened 1 year ago

orlitzky commented 1 year ago

The mallinfo() function from malloc.h is deprecated, and has been replaced by mallinfo2(). Additionally, the mallinfo struct that it returns has been replaced by a mallinfo2 struct. The only difference between the two is that the newer struct contains members of type size_t rather than int, which proved to be too small (leading to overflows).

The call to ssprintf() that prints this information has been updated to use the z length modifier, which is C99, but which is probably safe by now. Other C99 features are already being used by rbldnsd.

orlitzky commented 1 year ago

mallinfo was deprecated and replaced only at the beginning of 2021, so mallinfo2 may not be available on LTS distros yet:

https://sourceware.org/pipermail/libc-alpha/2021-February/122207.html

The ./configure check should avoid any problems, but maybe you want to wait if you think that's too new to be disabling the feature. (But keep in mind that it's buggy as-is.)