)]}'
{
  "commit": "85d4afe3dc5effe2945103fe596e363cb40f79d7",
  "tree": "b2cd3beaf6f8b39adab5a444a92c42e8ba3660b0",
  "parents": [
    "39932880fcbad0405565686e62f2e1a2c7cfdf7d"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:42:12 2026 -0500"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 16:11:21 2026 -0500"
  },
  "message": "json-c: accept a bare number or boolean, refuse a bare null\n\nThe five header setters (jwt_signature_add_protected_json,\njwt_signature_add_header_json, jwe_builder_add_protected_json,\njwe_builder_add_unprotected_json, jwe_recipient_add_header_json) parse the\nvalue with jwt_json_parse(..., JWT_JSON_DECODE_ANY, ...). With json-c a\nbare number or literal has no closing delimiter, so json-c cannot tell it\nhas ended and reports json_tokener_continue, which the wrapper took for a\nparse error: 1, -1, 1.5, true and false were refused, though Jansson (and\nthe documented contract of these setters) accepts them.\n\nGive json-c the end of the input it needs: jwt_json_parse() parses a C\nstring with slen + 1 so the terminating NUL is included, and\njwt_json_parse_buf(), whose buffer is not NUL-terminated, ends its input\nwith a second json_tokener_parse_ex() call on a lone NUL when the first\nreturns json_tokener_continue. That second call restarts json-c\u0027s\nparse-end counter, so validate_parsed() now takes the parse end from the\nfirst call rather than reading it from the tokener.\n\nA bare JSON null is refused by both backends: json-c has no object to\nstore one (it represents a null as a C NULL, which every caller reads as\nabsent), so the Jansson parser is made to refuse a top-level null too,\nrather than silently accept one the json-c backend cannot. Only a\nDECODE_ANY caller can reach that path; the default mode already rejects a\ntop-level non-array/object. The documented accepted-types list for\njwe_builder_add_protected_json() notes that null is refused.\n\nTested under both JSON backends for all five setters: numbers and\nbooleans are accepted and emitted as JSON scalars, a bare null and\ntrailing data (1 2, {} x) are refused.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\nSigned-off-by: Ben Collins \u003cbcollins@libjwt.io\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3a5d07c08d5839a2d8ae66cae886ea9f66336376",
      "old_mode": 33188,
      "old_path": "include/jwt.h",
      "new_id": "2ea6137b44197054408310975448334c99a08c53",
      "new_mode": 33188,
      "new_path": "include/jwt.h"
    },
    {
      "type": "modify",
      "old_id": "8fdec269afedb952339c88e97d020445f2032d3d",
      "old_mode": 33188,
      "old_path": "libjwt/jansson/jwt-jansson.c",
      "new_id": "536d3c3a16ba87abd0b1dfa6b20158abe1926959",
      "new_mode": 33188,
      "new_path": "libjwt/jansson/jwt-jansson.c"
    },
    {
      "type": "modify",
      "old_id": "aa6402c29961de62fdb7a335bac9844d48dc50b4",
      "old_mode": 33188,
      "old_path": "libjwt/json-c/jwt-json-c.c",
      "new_id": "e8be4423bd535d71a6de9ffbbbbd8c3a566473a3",
      "new_mode": 33188,
      "new_path": "libjwt/json-c/jwt-json-c.c"
    },
    {
      "type": "modify",
      "old_id": "ad14723135cae1ecb987b646b4257bbe24d818d9",
      "old_mode": 33188,
      "old_path": "tests/jwe_json.c",
      "new_id": "30dbc68fe96b219d0ce7bbd5a137d840ac293ca8",
      "new_mode": 33188,
      "new_path": "tests/jwe_json.c"
    },
    {
      "type": "modify",
      "old_id": "df1685b60175235fc6757dc88053874099922306",
      "old_mode": 33188,
      "old_path": "tests/jwe_multi.c",
      "new_id": "fe68aa0c2a7357412804d699e9996cbfc8ef5944",
      "new_mode": 33188,
      "new_path": "tests/jwe_multi.c"
    },
    {
      "type": "modify",
      "old_id": "4ce15ffcc7614624194b3e5f20f224cca6c0c876",
      "old_mode": 33188,
      "old_path": "tests/jws_json.c",
      "new_id": "5061e079889ba545b33ead1b350d0719d3db8db5",
      "new_mode": 33188,
      "new_path": "tests/jws_json.c"
    }
  ]
}
