aboutsummaryrefslogtreecommitdiffstats
path: root/src/logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logging.c')
-rw-r--r--src/logging.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/logging.c b/src/logging.c
index 2a8bfdc8..d32ca43a 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -336,6 +336,11 @@ err:
* which should never happen unless even the DLGLOBAL category is missing. */
static inline int map_subsys(int subsys)
{
+ /* Note: comparing signed and unsigned integers */
+
+ if (subsys > 0 && ((unsigned int)subsys) >= osmo_log_info->num_cat_user)
+ subsys = DLGLOBAL;
+
if (subsys < 0)
subsys = subsys_lib2index(subsys);