[747] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

bug in zephyrd in subscr.c

daemon@ATHENA.MIT.EDU (Derrick J. Brashear)
Tue Feb 20 11:52:20 1996

Date: Tue, 20 Feb 1996 11:45:21 -0500 (EST)
From: "Derrick J. Brashear" <shadow+@andrew.cmu.edu>
To: bug-zephyr@MIT.EDU

Unless I'm missing something, this bug can cause an unsubscribe to remove
far more than the intended number of subscriptions.

*** subscr.c    Tue Jul 18 16:29:13 1995
--- subscr.c.new        Tue Feb 20 11:44:02 1996
***************
*** 297,303 ****
      ZNotice_t *notice;
  {
      Client *who;
!     Destlist *cancel_subs, *subs, *client_subs, *next;
      Code_t retval;
      int found = 0;
      int relation;
--- 297,303 ----
      ZNotice_t *notice;
  {
      Client *who;
!     Destlist *cancel_subs, *subs, *client_subs, *next, *next2;
      Code_t retval;
      int found = 0;
      int relation;
***************
*** 318,325 ****
  
      for (subs = cancel_subs; subs; subs = next) {
        next = subs->next;
!       for (client_subs = who->subs; client_subs; client_subs = next) {
!           next = client_subs->next;
            if (ZDest_eq(&client_subs->dest, &subs->dest)) {
                LIST_DELETE(client_subs);
                triplet_deregister(who, &client_subs->dest);
--- 318,325 ----
  
      for (subs = cancel_subs; subs; subs = next) {
        next = subs->next;
!       for (client_subs = who->subs; client_subs; client_subs = next2) {
!           next2 = client_subs->next;
            if (ZDest_eq(&client_subs->dest, &subs->dest)) {
                LIST_DELETE(client_subs);
                triplet_deregister(who, &client_subs->dest);
---
Enjoy

-D

home help back first fref pref prev next nref lref last post