Patches for DB version 2.0.0

  1. Problem: DB can core dump when parsing NAME/VALUE configuration pairs.
    Apply the following patch to the common/db_appinit.c file.  
    *** common/db_appinit.c.orig    Wed Dec 31 19:00:00 1969
    --- common/db_appinit.c Fri Apr 11 13:17:44 1997
    ***************
    *** 430,436 ****
            char *s;
      {
            int ret;
    !       char *local_s, *name, *value, **p;
      
            ret = 0;
      
    --- 430,436 ----
            char *s;
      {
            int ret;
    !       char *local_s, *name, *value, **p, *tp;
      
            ret = 0;
      
    ***************
    *** 441,450 ****
            if ((local_s = strdup(s)) == NULL)
                    return (ENOMEM);
      
    !       while ((name = strsep(&local_s, " \t")) != NULL && *name == '\0');
            if (name == NULL)
                    goto err;
    !       while ((value = strsep(&local_s, " \t")) != NULL && *value == '\0');
            if (value == NULL) {
      err:          __db_err(dbenv, "illegal name-value pair");
                    ret = EINVAL;
    --- 441,451 ----
            if ((local_s = strdup(s)) == NULL)
                    return (ENOMEM);
      
    !       tp = local_s;
    !       while ((name = strsep(&tp, " \t")) != NULL && *name == '\0');
            if (name == NULL)
                    goto err;
    !       while ((value = strsep(&tp, " \t")) != NULL && *value == '\0');
            if (value == NULL) {
      err:          __db_err(dbenv, "illegal name-value pair");
                    ret = EINVAL;
    

     

  2. Problem: DB can return deleted records in some situations.
    Apply the following patch to the btree/bt_delete.c file.  
    *** btree/bt_delete.c.orig      Fri Apr  4 11:08:21 1997
    --- btree/bt_delete.c   Sat Apr 12 11:27:29 1997
    ***************
    *** 102,108 ****
                            break;
            for (; cnt > 0; --cnt, ++t->bt_deleted)
                    if (__bt_ca_delete(dbp, h->pgno, indx, NULL) != 0) {
    !                       GET_BKEYDATA(h, indx)->deleted = 1;
                            indx += P_INDX;
                    } else {
                            if ((ret = __bt_ditem(dbp, h, indx)) != 0)
    --- 102,108 ----
                            break;
            for (; cnt > 0; --cnt, ++t->bt_deleted)
                    if (__bt_ca_delete(dbp, h->pgno, indx, NULL) != 0) {
    !                       GET_BKEYDATA(h, indx + O_INDX)->deleted = 1;
                            indx += P_INDX;
                    } else {
                            if ((ret = __bt_ditem(dbp, h, indx)) != 0)
    

In-Memory Replay Banner