diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-12-12 14:34:41 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-12-12 15:47:32 +0100 |
commit | 85b42c46184118db2aaa50e44e97966523dd0269 (patch) | |
tree | 17b3f6fb7afea3b319e9fd445cce7e15530bcd2d /src/gsm/gea.c | |
parent | 9adf32fb60206065026e9c3ef7088ef6bcc013be (diff) |
show bug in logging: erratic redirection to DLGLOBAL for invalid categories
Add a check to logging_test.c to show a bug: when a logging category value that
is out-of-bounds is passed to the logging system, the internal map_subsys()
function should remap that to DLGLOBAL. But in fact DLGLOBAL is -1 and the
function fails to map this to a proper positive array index, directly returning
-1 instead. This results in a negative array index and undefined behavior. A
sanitize build should catch this.
The bug is confirmed by the fact that logging_test.err stays the same
(hopefully) although a logging output should appear from this patch. The test
could as well segfault or anything else, it's a bit of a gamble.
This bug will be fixed along with the expectation in a subsequent patch.
Note: osmo_log_info->num_cat + 0 is also out-of-bounds, but there is a separate
bug there, so leaving this for another patch.
Change-Id: I161b6550fa204a872bad1abefee1a6155393fafd
Diffstat (limited to 'src/gsm/gea.c')
0 files changed, 0 insertions, 0 deletions