From fabe3b7dd0df4580948c841c60d187bf7d825ae3 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 6 Dec 2007 21:16:02 +0100 Subject: [PATCH] fix possible segfault on fdi-cache recreation This fixes https://bugzilla.novell.com/show_bug.cgi?id=344231, where HAL crash if a fdi-file get changed/updated and a new device appears after the recreation of the FDI cache. --- hald/device_info.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hald/device_info.c b/hald/device_info.c index d601e60..88936cd 100644 --- a/hald/device_info.c +++ b/hald/device_info.c @@ -1119,13 +1119,15 @@ rules_match_and_merge_device (void *fdi_rules_list, HalDevice *d) /* merge the device info type, either preprobe, info or policy */ gboolean di_search_and_merge (HalDevice *d, DeviceInfoType type){ - struct cache_header *header = (struct cache_header*) RULES_PTR(0); + struct cache_header *header; /* make sure our fdi rule cache is up to date */ if (di_cache_coherency_check (FALSE)) { di_rules_init (); } + header = (struct cache_header*) RULES_PTR(0); + switch (type) { case DEVICE_INFO_TYPE_PREPROBE: /* Checking if we have at least one preprobe rule */ -- 1.5.3.7