From e7ecd02a099075e633bc4803e42456493ef26a93 Mon Sep 17 00:00:00 2001 From: Ales Hvezda Date: Mon, 16 Apr 2007 03:00:27 +0000 Subject: [PATCH] Added missing test to prevent a seg fault when loading up a schematic with missing attributes. --- gattrib/ChangeLog | 5 +++++ gattrib/src/s_string_list.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gattrib/ChangeLog b/gattrib/ChangeLog index c865f764a..35fe7d1c5 100644 --- a/gattrib/ChangeLog +++ b/gattrib/ChangeLog @@ -1,3 +1,8 @@ +2007-04-15 Ales Hvezda + + * src/s_string_list.c: Added missing test to prevent a seg fault + when loading up a schematic with missing attributes. + 2007-4-15 Stuart Brorson * Makefile.am, configure.ac, docs/*: Created new docs directory, and set up framework to create doxygen generated diff --git a/gattrib/src/s_string_list.c b/gattrib/src/s_string_list.c index ab6fd3c57..731c6a5c5 100644 --- a/gattrib/src/s_string_list.c +++ b/gattrib/src/s_string_list.c @@ -378,11 +378,13 @@ void s_string_list_sort_master_comp_attrib_list() { int i; p->pos = DEFAULT_ATTRIB_POS; for (i=0; idata) == 0) - { + if (p->data != NULL) { + if (strcmp (certain_attribs[i].attrib, p->data) == 0) + { p->pos = certain_attribs[i].pos; break; } + } } local_list = listsort(local_list, 0, 1); -- 2.11.4.GIT