You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2026/06/13 20:30:21 UTC

(couchdb-jiffy) tag 1.1.5 created (now 50c0b8d)

This is an automated email from the ASF dual-hosted git repository.

nickva pushed a change to tag 1.1.5
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git


      at 50c0b8d  (commit)
This tag includes the following new commits:

     new f4c3955  Fixup license name to make Hex happy
     new e140b34  Fix unitialized var access on allocation failure
     new 738cce8  Add OTP 29 support. Fix beam Windows 2025 CI.
     new 50c0b8d  Tag 1.1.5 release

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(couchdb-jiffy) 04/04: Tag 1.1.5 release

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to tag 1.1.5
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit 50c0b8dcd7700019059b0b20e2387cebfbaddd56
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Fri Jun 12 20:00:05 2026 -0400

    Tag 1.1.5 release
---
 src/jiffy.app.src | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/jiffy.app.src b/src/jiffy.app.src
index b484456..2d90cfb 100644
--- a/src/jiffy.app.src
+++ b/src/jiffy.app.src
@@ -1,6 +1,6 @@
 {application, jiffy, [
     {description, "JSON Decoder/Encoder."},
-    {vsn, "1.1.4"},
+    {vsn, "1.1.5"},
     {registered, []},
     {applications, [kernel, stdlib, xmerl]},
     {maintainers, ["Paul J. Davis"]},


(couchdb-jiffy) 01/04: Fixup license name to make Hex happy

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to tag 1.1.5
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit f4c395529cee29d08a2c4f73ed422a2f16ac0d43
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Mon Jun 8 22:13:18 2026 -0400

    Fixup license name to make Hex happy
    
    Hex wants a specific BSD license type or it won't let us publish.
    
    Conferring with Paul we decided on a 3-clause version.
---
 src/jiffy.app.src | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/jiffy.app.src b/src/jiffy.app.src
index ff97df6..b484456 100644
--- a/src/jiffy.app.src
+++ b/src/jiffy.app.src
@@ -4,7 +4,7 @@
     {registered, []},
     {applications, [kernel, stdlib, xmerl]},
     {maintainers, ["Paul J. Davis"]},
-    {licenses, ["MIT", "BSD"]},
+    {licenses, ["MIT", "BSD-3-Clause"]},
     {links, [{"GitHub", "https://github.com/davisp/jiffy"}]},
     {files, [
         "LICENSE",


(couchdb-jiffy) 02/04: Fix unitialized var access on allocation failure

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to tag 1.1.5
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit e140b344a62653f9686d4772810da34bf6b0d5b1
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Fri Jun 12 18:00:05 2026 -0400

    Fix unitialized var access on allocation failure
    
    Fix two places where we didn't handle allocation failures. While
    `enif_alloc_resource()` blows up on allocation failure, `enif_alloc()` and
    `enif_alloc_binary()` don't. During encoder and decoder resource creation if
    small (a few KB) mallocs fail we could end up calling the resource destructor
    with some uninitalized flags like `have_buffer`.
    
    To prevent this class of errors in the future opt to memset the encoder and
    decoder structure so new fields in the future are by default 0-initialized.
    
    Thanks to @qzhuyan (William) in https://github.com/davisp/jiffy/pull/296 for
    pointing this issue out and providing a fix.
---
 c_src/decoder.c | 19 +++++++++----------
 c_src/encoder.c | 16 ++++------------
 2 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/c_src/decoder.c b/c_src/decoder.c
index 27d101a..01d0215 100644
--- a/c_src/decoder.c
+++ b/c_src/decoder.c
@@ -66,6 +66,7 @@ typedef struct {
     int             st_top;
 } Decoder;
 
+// Returns an allocated resource or NULL on allocation failure
 Decoder*
 dec_new(ErlNifEnv* env)
 {
@@ -77,23 +78,21 @@ dec_new(ErlNifEnv* env)
         return NULL;
     }
 
-    d->atoms = st;
+    // Zero everything and only set non-0 fields
+    memset(d, 0, sizeof(*d));
 
+    d->atoms = st;
     d->bytes_per_red = DEFAULT_BYTES_PER_REDUCTION;
-    d->is_partial = 0;
-    d->return_maps = 0;
-    d->return_trailer = 0;
-    d->dedupe_keys = 0;
-    d->copy_strings = 0;
     d->null_term = d->atoms->atom_null;
-
-    d->p = NULL;
     d->len = -1;
-    d->i = 0;
 
     d->st_data = (char*) enif_alloc(STACK_SIZE_INC);
+    if(d->st_data == NULL) {
+        enif_release_resource(d);
+        return NULL;
+    }
+
     d->st_size = STACK_SIZE_INC;
-    d->st_top = 0;
 
     for(i = 0; i < d->st_size; i++) {
         d->st_data[i] = st_invalid;
diff --git a/c_src/encoder.c b/c_src/encoder.c
index 03c5500..2ec0dd8 100644
--- a/c_src/encoder.c
+++ b/c_src/encoder.c
@@ -72,29 +72,21 @@ enc_new(ErlNifEnv* env)
     jiffy_st* st = (jiffy_st*) enif_priv_data(env);
     Encoder* e = enif_alloc_resource(st->res_enc, sizeof(Encoder));
 
+    // Zero everything so enc_destroy() never sees an uninitialized
+    // have_buffer if we bail out before the encoder is fully built
+    memset(e, 0, sizeof(*e));
+
     e->atoms = st;
     e->bytes_per_red = DEFAULT_BYTES_PER_REDUCTION;
-    e->uescape = 0;
-    e->pretty = 0;
-    e->use_nil = 0;
-    e->escape_forward_slashes = 0;
-    e->shiftcnt = 0;
-    e->count = 0;
-
-    e->iosize = 0;
     e->iolist = enif_make_list(env, 0);
 
-    e->partial_output = 0;
-
     if(!enif_alloc_binary(BIN_INC_SIZE, &e->buffer)) {
         enif_release_resource(e);
         return NULL;
     }
 
     e->have_buffer = 1;
-
     e->p = e->buffer.data;
-    e->i = 0;
 
     return e;
 }


(couchdb-jiffy) 03/04: Add OTP 29 support. Fix beam Windows 2025 CI.

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to tag 1.1.5
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit 738cce800de50bafc740c1d96051ed06cddbb500
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Fri Jun 12 18:38:05 2026 -0400

    Add OTP 29 support. Fix beam Windows 2025 CI.
---
 .github/workflows/ci.yml | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2f811b1..900d458 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,7 +17,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        otp_version: [20,23,26,27,28]
+        otp_version: [20,23,26,27,28,29]
         os: [ubuntu-latest]
         rebar: [rebar, rebar3]
 
@@ -65,10 +65,15 @@ jobs:
       run: |
           git config --global core.autocrlf false
           git config --global core.eol lf
-    - uses: actions/checkout@v4
-    - name: install rebar3
-      run: |
-        choco install rebar3
+    - uses: actions/checkout@v6
+    - uses: erlef/setup-beam@v1
+      # New runner images report win25-vs2026 and
+      # setup-beam cannot map (yet), so override for now
+      env:
+        ImageOS: ${{ matrix.os == 'windows-2025' && 'win25' || 'win22' }}
+      with:
+        otp-version: '27'
+        rebar3-version: '3.23'
     - name: make check
       run: |
         $path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -nologo -nocolor -property installationPath