Skip to content

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

Open
orlitzky wants to merge 1 commit into
spamhaus:masterfrom
orlitzky:mallinfo2
Open

configure,rbldnsd.c: replace mallinfo() with mallinfo2()#30
orlitzky wants to merge 1 commit into
spamhaus:masterfrom
orlitzky:mallinfo2

Conversation

@orlitzky

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
Contributor Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant