This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/15974] New: Unsupported notification packets are causing errors (last of the nc_list is picked).


https://sourceware.org/bugzilla/show_bug.cgi?id=15974

            Bug ID: 15974
           Summary: Unsupported notification packets are causing errors
                    (last of the nc_list is picked).
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: critical
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: forum at emblocks dot org

In the file remote-notif.c:




/* Supported clients of notifications.  */

static struct notif_client *notifs[] =
{
  &notif_client_stop,
};


  for (i = 0; i < ARRAY_SIZE (notifs); i++)
    {
      nc = notifs[i];
      if (strncmp (buf, nc->name, strlen (nc->name)) == 0
      && buf[strlen (nc->name)] == ':')
    break;
    }

  /* We ignore notifications we don't recognize, for compatibility
     with newer stubs.  */
  if (nc == NULL)
    return;


If the notification packet is not in the list then the last (in this case the
only) entry is used as valid. It should be NULL and break away.

Solution:
- terminate the list with NULL
- or make the iteration through the list error-proof.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]