get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/125817/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 125817,
    "url": "https://patches.dpdk.org/api/patches/125817/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230405154414.183915-6-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230405154414.183915-6-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230405154414.183915-6-bruce.richardson@intel.com",
    "date": "2023-04-05T15:44:14",
    "name": "[v2,5/5] telemetry: remove VLA in json string format function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4509d8bfb1bd9ea483a7f12912eb2a8319665983",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230405154414.183915-6-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 27628,
            "url": "https://patches.dpdk.org/api/series/27628/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27628",
            "date": "2023-04-05T15:44:09",
            "name": "telemetry: remove variable length arrays",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/27628/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/125817/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/125817/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BD615428D4;\n\tWed,  5 Apr 2023 17:45:08 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C28BA42D0C;\n\tWed,  5 Apr 2023 17:44:41 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 7DE3A42D0C\n for <dev@dpdk.org>; Wed,  5 Apr 2023 17:44:40 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Apr 2023 08:44:40 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.40])\n by orsmga002.jf.intel.com with ESMTP; 05 Apr 2023 08:44:38 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1680709480; x=1712245480;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=3AkT5t0n+8KM11Lio4V7yr97BYKxeiFJwttdaTNR43I=;\n b=NRAG5+9wghQj09hpgNe4TmlAXT9o9BGCjv36KM+l8BmaL0V3ak5HTf+G\n cc6DZ6F7qukGyIm9/S8EQAgpHLZbQpD9YsAzv7BmiZHcF3Y23dGtL2BGR\n iH+D/CES1xUpMbiQJpiiWipqmO297b3aQN1UTR1xmT0Vl72+P+fYLidpc\n flchVcwdTKqGpR5lIVj5lq2xjfGZt+AeAtgl5cpPoopUHhsDKF1KDbp29\n bxbmtWoSWM4y5IuCtSxtE78iGs9uvL5The1/iw2oZYJ5xvKZjsR7JvoRC\n yHHcZRURTxKM3zrht/b+3sjhvHq0aSCXVzM06aEBNsOSOozXhbhv7L3w+ A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10671\"; a=\"339980405\"",
            "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"339980405\"",
            "E=McAfee;i=\"6600,9927,10671\"; a=\"686790315\"",
            "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"686790315\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "ciara.power@intel.com, roretzla@linux.microsoft.com,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[PATCH v2 5/5] telemetry: remove VLA in json string format function",
        "Date": "Wed,  5 Apr 2023 16:44:14 +0100",
        "Message-Id": "<20230405154414.183915-6-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230405154414.183915-1-bruce.richardson@intel.com>",
        "References": "<20230310181836.162336-1-bruce.richardson@intel.com>\n <20230405154414.183915-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Since variable length arrays (VLAs) are potentially unsecure and\nunsupported by some compilers, rework the code to remove their use. As\nwith previous changes to remove VLAs in the telemetry code, this\nfunction uses two methods to avoid modifying the buffer when adding to\nit fails:\n* if there are only a few characters in the buffer, save them off to\n  restore on failure, then use the buffer as-is,\n* otherwise use malloc rather than a VLA to allocate a temporary buffer\n  and copy from that on success only.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test/test_telemetry_json.c |  2 +-\n lib/telemetry/telemetry_json.h | 19 +++++++++++++++++--\n 2 files changed, 18 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/test/test_telemetry_json.c b/app/test/test_telemetry_json.c\nindex e81e3a8a98..5617eac540 100644\n--- a/app/test/test_telemetry_json.c\n+++ b/app/test/test_telemetry_json.c\n@@ -129,7 +129,7 @@ test_string_char_escaping(void)\n {\n \tstatic const char str[] = \"A string across\\ntwo lines and \\\"with quotes\\\"!\";\n \tconst char *expected = \"\\\"A string across\\\\ntwo lines and \\\\\\\"with quotes\\\\\\\"!\\\"\";\n-\tchar buf[sizeof(str) + 10];\n+\tchar buf[sizeof(str) + 10] = \"\";\n \tint used = 0;\n \n \tused = rte_tel_json_str(buf, sizeof(buf), used, str);\ndiff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h\nindex 4d725d938b..fceff91842 100644\n--- a/lib/telemetry/telemetry_json.h\n+++ b/lib/telemetry/telemetry_json.h\n@@ -130,13 +130,28 @@ __json_format_str_to_buf(char *buf, const int len,\n static inline int\n __json_format_str(char *buf, const int len, const char *prefix, const char *str, const char *suffix)\n {\n-\tchar tmp[len];\n \tint ret;\n+\tchar saved[4] = \"\";\n+\tchar *tmp;\n+\n+\tif (strnlen(buf, sizeof(saved)) < sizeof(saved)) {\n+\t\t/* we have only a few bytes in buffer, so save them off to restore on error*/\n+\t\tstrcpy(saved, buf);\n+\t\tret = __json_format_str_to_buf(buf, len, prefix, str, suffix);\n+\t\tif (ret == 0)\n+\t\t\tstrcpy(buf, saved); /* restore */\n+\t\treturn ret;\n+\t}\n+\n+\ttmp = malloc(len);\n+\tif (tmp == NULL)\n+\t\treturn 0;\n \n \tret = __json_format_str_to_buf(tmp, len, prefix, str, suffix);\n \tif (ret > 0)\n-\t\tstrcpy(buf, tmp);\n+\t\tstrcpy(buf, saved);\n \n+\tfree(tmp);\n \treturn ret;\n }\n \n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}