get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134141,
    "url": "http://patches.dpdk.org/api/patches/134141/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231113104550.2138654-11-haijie1@huawei.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": "<20231113104550.2138654-11-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231113104550.2138654-11-haijie1@huawei.com",
    "date": "2023-11-13T10:45:39",
    "name": "[10/21] lib/eal: replace strtok with strtok_r",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9c9e9a5f076323586119dd85f63adba76e226eeb",
    "submitter": {
        "id": 2935,
        "url": "http://patches.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@huawei.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/20231113104550.2138654-11-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 30264,
            "url": "http://patches.dpdk.org/api/series/30264/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30264",
            "date": "2023-11-13T10:45:29",
            "name": "replace strtok with strtok_r",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30264/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/134141/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/134141/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 6A82D430AB;\n\tMon, 13 Nov 2023 11:51:58 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D44E240DC9;\n\tMon, 13 Nov 2023 11:51:06 +0100 (CET)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 56E524067E\n for <dev@dpdk.org>; Mon, 13 Nov 2023 11:51:00 +0100 (CET)",
            "from kwepemd100004.china.huawei.com (unknown [172.30.72.57])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4STR6R1qk6zWhCW\n for <dev@dpdk.org>; Mon, 13 Nov 2023 18:50:39 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) by\n kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.1258.23; Mon, 13 Nov 2023 18:50:58 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<dev@dpdk.org>, Anatoly Burakov <anatoly.burakov@intel.com>",
        "CC": "<haijie1@huawei.com>, <lihuisong@huawei.com>, <fengchengwen@huawei.com>",
        "Subject": "[PATCH 10/21] lib/eal: replace strtok with strtok_r",
        "Date": "Mon, 13 Nov 2023 18:45:39 +0800",
        "Message-ID": "<20231113104550.2138654-11-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20231113104550.2138654-1-haijie1@huawei.com>",
        "References": "<20231113104550.2138654-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.2]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n kwepemd100004.china.huawei.com (7.221.188.31)",
        "X-CFilter-Loop": "Reflected",
        "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": "Multiple threads calling the same function may cause condition\nrace issues, which often leads to abnormal behavior and can cause\nmore serious vulnerabilities such as abnormal termination, denial\nof service, and compromised data integrity.\n\nThe strtok() is non-reentrant, it is better to replace it with a\nreentrant function.\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n lib/eal/common/eal_common_memory.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c\nindex d9433db62345..a05eb0442b0b 100644\n--- a/lib/eal/common/eal_common_memory.c\n+++ b/lib/eal/common/eal_common_memory.c\n@@ -1273,22 +1273,22 @@ parse_params(const char *params, uint32_t *vals, size_t n_vals)\n \tchar dlim[2] = \",\";\n \tchar *params_args;\n \tsize_t count = 0;\n-\tchar *token;\n+\tchar *token, *sp = NULL;\n \n \tif (vals == NULL || params == NULL || strlen(params) == 0)\n \t\treturn -1;\n \n-\t/* strtok expects char * and param is const char *. Hence on using\n+\t/* strtok_r expects char * and param is const char *. Hence on using\n \t * params as \"const char *\" compiler throws warning.\n \t */\n \tparams_args = strdup(params);\n \tif (params_args == NULL)\n \t\treturn -1;\n \n-\ttoken = strtok(params_args, dlim);\n+\ttoken = strtok_r(params_args, dlim, &sp);\n \twhile (token && isdigit(*token) && count < n_vals) {\n \t\tvals[count++] = strtoul(token, NULL, 10);\n-\t\ttoken = strtok(NULL, dlim);\n+\t\ttoken = strtok_r(NULL, dlim, &sp);\n \t}\n \n \tfree(params_args);\n",
    "prefixes": [
        "10/21"
    ]
}