From 1a02cfc24d2c812ba13e5aa936588be447bb24af Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 19 Mar 2013 10:37:39 +0100 Subject: logging_vty: Fix segfault un unused entries in log_info_cat array of app --- src/vty/logging_vty.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vty/logging_vty.c') diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index fc1ca430..a6d2f522 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -632,6 +632,10 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt) const struct log_category *cat = &tgt->categories[i]; char cat_lower[32]; + /* skip empty entries in the array */ + if (!osmo_log_info->cat[i].name) + continue; + /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); -- cgit v1.2.3