From 059abc4b56dfa68d15432004d178d60f1624cfa9 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 21 Feb 2026 19:38:45 +0100 Subject: [PATCH] "STATS fdtable" is mostly for debugging. Simplify read/write handler display and callback data in non-DEBUGMODE. Also because exposing pointers like this can defeat ASLR. These STATS are oper-only though, but hey, defense in depth... and the pointer values don't make sense to non-devs anyway, so why show them in the first place. --- src/modules/stats.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/stats.c b/src/modules/stats.c index 5090353c7..449d1a1e3 100644 --- a/src/modules/stats.c +++ b/src/modules/stats.c @@ -643,9 +643,15 @@ int stats_fdtable(Client *client, const char *para) if (!fde->is_open) continue; +#ifndef DEBUGMODE + sendnumericfmt(client, RPL_STATSDEBUG, + "fd %3d, desc '%s', read-hdl %d, write-hdl %d, cbdata %d", + fde->fd, fde->desc, fde->read_callback ? 1 : 0, fde->write_callback ? 1 : 0, fde->data ? 1 : 0); +#else sendnumericfmt(client, RPL_STATSDEBUG, "fd %3d, desc '%s', read-hdl %p, write-hdl %p, cbdata %p", fde->fd, fde->desc, fde->read_callback, fde->write_callback, fde->data); +#endif } return 0;