get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125823,
    "url": "http://patches.dpdk.org/api/patches/125823/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230405160326.186921-6-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230405160326.186921-6-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230405160326.186921-6-bruce.richardson@intel.com",
    "date": "2023-04-05T16:03:26",
    "name": "[v3,5/5] telemetry: remove VLA in json string format function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4509d8bfb1bd9ea483a7f12912eb2a8319665983",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230405160326.186921-6-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 27629,
            "url": "http://patches.dpdk.org/api/series/27629/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27629",
            "date": "2023-04-05T16:03:21",
            "name": "telemetry: remove variable length arrays",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/27629/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125823/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/125823/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 8B8E1428D4;\n\tWed,  5 Apr 2023 18:05:18 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5364242D3D;\n\tWed,  5 Apr 2023 18:04:52 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 7AED542D3F\n for <dev@dpdk.org>; Wed,  5 Apr 2023 18:04:50 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Apr 2023 09:04:23 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.40])\n by fmsmga001.fm.intel.com with ESMTP; 05 Apr 2023 09:04:22 -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=1680710690; x=1712246690;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=lD4rRLY1FW6QSObnxnPfchXl6ww0aUf8D51zJ97VRdU=;\n b=Nr+DBkwxuNKt9za5pvu3mCjkli3lAVOU/4RTS17bKA9yDyVV2GSf5Mxk\n dSbdn5B/+N6uO7GVvNaHoDIMalXxLbj3VySNzMFTawRp3mtO6WRS7fYgL\n jqCUP3sj3T6m943+dK8RU0D0k53OYmXfOmxzgokfa/AyVrsAnCcAPjrTy\n YIZtXMFJZdnKbpj1TvlWJkJCWlpeWhXI45iE+lCx/YAJL11R9lcJsZrB7\n cSth0jmzC/+8lwP5b8Vjx/VEqUVyDcpzsaCXw8vC0Hg5Qw1PIhqLNU+2B\n Qgt/0blC+2iwnE2a8AfiKQ1rO94R0RlJwkvQwCIvZRZ8e3tut4oxaWMhD A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10671\"; a=\"341218633\"",
            "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"341218633\"",
            "E=McAfee;i=\"6600,9927,10671\"; a=\"830405832\"",
            "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"830405832\""
        ],
        "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 v3 5/5] telemetry: remove VLA in json string format function",
        "Date": "Wed,  5 Apr 2023 17:03:26 +0100",
        "Message-Id": "<20230405160326.186921-6-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230405160326.186921-1-bruce.richardson@intel.com>",
        "References": "<20230310181836.162336-1-bruce.richardson@intel.com>\n <20230405160326.186921-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 insecure 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 c087b833eb..7999535848 100644\n--- a/lib/telemetry/telemetry_json.h\n+++ b/lib/telemetry/telemetry_json.h\n@@ -134,13 +134,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": [
        "v3",
        "5/5"
    ]
}