logging_vty: Fix segfault un unused entries in log_info_cat array of app

This commit is contained in:
Harald Welte 2013-03-19 10:37:39 +01:00
parent 54c5ed1518
commit 1a02cfc24d
1 changed files with 4 additions and 0 deletions

View File

@ -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));