And this one fix another segfault uncovered by previous patch :)
Seriously, what's the magic command-line option which enables logging without 
causing
segfaults?

-- 
best regards,
Max, http://fairwaves.ru
>From 7eae9135036e33ed792186a2e07e8c13d7f2dd6a Mon Sep 17 00:00:00 2001
From: Max <[email protected]>
Date: Fri, 21 Sep 2012 18:33:00 +0200
Subject: [PATCH] fix segfault during show running-config

---
 src/vty/logging_vty.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 6166f1f..71d926d 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -547,7 +547,7 @@ static int config_write_log_single(struct vty *vty, struct log_target *tgt)
 	for (i = 0; i < osmo_log_info->num_cat; i++) {
 		const struct log_category *cat = &tgt->categories[i];
 		char cat_lower[32];
-
+		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));
-- 
1.7.9.5

Reply via email to