]> source.dussan.org Git - rspamd.git/commit
[Fix] buffer overflow in rspamc counters
authorAnton Yuzhaninov <citrin+git@citrin.ru>
Tue, 21 Sep 2021 09:00:17 +0000 (10:00 +0100)
committerAnton Yuzhaninov <citrin+git@citrin.ru>
Tue, 21 Sep 2021 09:06:22 +0000 (10:06 +0100)
commit8e8c92c0ca8c87a7dfb8921ae8aa72e6b767d97e
treec643f6a4850a8eedebf5c90f1a65b1c2dd9c1aa2
parent4768b36e4d0d18f43962e4c54108ac1257f144fc
[Fix] buffer overflow in rspamc counters

If request to /counters returns no symbols then max_len would have
a negative value:

Results for command: counters (0.003 seconds)
=================================================================
==22096==ERROR: AddressSanitizer: negative-size-param: (size=-2147483604)
    #0 0x33ff13 in __asan_memset (/usr/bin/rspamc+0x33ff13)
    #1 0x383432 in rspamc_counters_output /usr/src/debug/rspamd/src/client/rspamc.c:1064:2
    #2 0x388c49 in rspamc_client_cb /usr/src/debug/rspamd/src/client/rspamc.c:1600:6
    ...
src/client/rspamc.c