gnetlist silently drops components

Bug #1268944 reported by Joshua Lansford
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
Undecided
Patrick Bernaud

Bug Description

gnetlist drops components without a trace or warning if the component has a valueless attribute.

I am running from git
commit c59ea5789e57df813ef7d84d78592a6a0b0d341e
Date: Fri Jan 25 14:28:38 2013 +0100

The following change fixes the problem:

diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 5dae202..cb161a1 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -383,7 +383,7 @@ o_attrib_string_get_name_value (const gchar *string, gchar **name_ptr, gchar **v
   prev_char = g_utf8_find_prev_char (string, ptr);
   next_char = g_utf8_find_next_char (ptr, NULL);
   if (prev_char == NULL || *prev_char == ' ' ||
- next_char == NULL || *next_char == ' ' || *next_char == '\0' ) {
+ next_char == NULL || *next_char == ' ' ) {
     return FALSE;
   }

The patch allows invalid valueless attributes as produced by gattrib to be processed without unexpected surprises.

This patch has not been extensively tested.

Changed in geda:
assignee: nobody → Patrick Bernaud (patrickb)
status: New → In Progress
Revision history for this message
Patrick Bernaud (patrickb) wrote :

libgeda's 'get-attrib-value-by-attrib' used to be resilient to invalid attributes but its reimplementation in Scheme (a3433b6a4c088b8926f8768e20eff18d0dafea4b) is instead choking on it.

The attached patch is catching and ignoring the 'attribute-format' exception that is thrown by 'parse-attrib'.

Revision history for this message
Peter TB Brett (peter-b) wrote :

Can't we fix gattrib to *not* create bogus attributes? *sigh*

Thanks for the patch.

Changed in geda:
status: In Progress → Won't Fix
status: Won't Fix → Fix Committed
Peter TB Brett (peter-b)
Changed in geda:
milestone: none → 1.9.1
Peter TB Brett (peter-b)
Changed in geda:
status: Fix Committed → Fix Released
Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

Bug was fixed by a commit
git master commit 55461d3726ececc2c6b7776b5d0cd84f558b1811
http://git.geda-project.org/geda-gaf/commit/?id=55461d3726ececc2c6b7776b5d0cd84f558b1811

commit 55461d3726ececc2c6b7776b5d0cd84f558b1811
Author: Patrick Bernaud <email address hidden>
Commit: Peter TB Brett <email address hidden>

    libgeda: Ignore invalid attributes when listing attribute values

    Fix the reimplementation of g_get_attrib_value_by_attrib(). The
    original function was accepting invalid attributes while the replacing
    Scheme reimplementation (a3433b6a4c088b8926f8768e20eff18d0dafea4b) is
    instead throwing an exception.

    Closes-bug: lp-1268944

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.