Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/35305/?format=api
http://patches.dpdk.org/api/patches/35305/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180220145001.18442-1-remy.horton@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": "<20180220145001.18442-1-remy.horton@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180220145001.18442-1-remy.horton@intel.com", "date": "2018-02-20T14:50:01", "name": "[dpdk-dev,v1] metrics: fix potential missing NULL termination", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0a0746a23398aab356eddb174301fa76cdc4baef", "submitter": { "id": 326, "url": "http://patches.dpdk.org/api/people/326/?format=api", "name": "Remy Horton", "email": "remy.horton@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180220145001.18442-1-remy.horton@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/35305/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/35305/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1189D1B172;\n\tTue, 20 Feb 2018 15:50:05 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 12261A48A\n\tfor <dev@dpdk.org>; Tue, 20 Feb 2018 15:50:03 +0100 (CET)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Feb 2018 06:50:03 -0800", "from rhorton-mobl1.ger.corp.intel.com (HELO FC23.ir.intel.com)\n\t([163.33.231.16])\n\tby orsmga006.jf.intel.com with ESMTP; 20 Feb 2018 06:50:02 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.46,539,1511856000\"; d=\"scan'208\";a=\"19735909\"", "From": "Remy Horton <remy.horton@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 20 Feb 2018 14:50:01 +0000", "Message-Id": "<20180220145001.18442-1-remy.horton@intel.com>", "X-Mailer": "git-send-email 2.9.5", "Subject": "[dpdk-dev] [PATCH v1] metrics: fix potential missing NULL\n\ttermination", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Fixes a potential memory overrun detected by Coverity.\nThis overrun cannot currently happen in practice because\nrte_metrics_reg_names() explicitly forces the last name\ncharacter to be a NULL terminator. This patch adds the\nsame enforcement to rte_metrics_get_names() in order to\ncorrect the warning.\n\nCoverity issue: 143434\nFixes: 349950ddb9c5 (\"metrics: add information metrics library\")\n\nSigned-off-by: Remy Horton <remy.horton@intel.com>\n---\n lib/librte_metrics/rte_metrics.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_metrics/rte_metrics.c b/lib/librte_metrics/rte_metrics.c\nindex 556ae1b..958ef3d 100644\n--- a/lib/librte_metrics/rte_metrics.c\n+++ b/lib/librte_metrics/rte_metrics.c\n@@ -214,10 +214,15 @@ rte_metrics_get_names(struct rte_metric_name *names,\n \t\t\trte_spinlock_unlock(&stats->lock);\n \t\t\treturn return_value;\n \t\t}\n-\t\tfor (idx_name = 0; idx_name < stats->cnt_stats; idx_name++)\n+\t\tfor (idx_name = 0; idx_name < stats->cnt_stats; idx_name++) {\n \t\t\tstrncpy(names[idx_name].name,\n \t\t\t\tstats->metadata[idx_name].name,\n \t\t\t\tRTE_METRICS_MAX_NAME_LEN);\n+\t\t/* Enforce NULL-termination. The source string should already\n+\t\t * be NULL-terminated, so this is to quieten lint checks..\n+\t\t */\n+\t\tnames[idx_name].name[RTE_METRICS_MAX_NAME_LEN - 1] = '\\0';\n+\t\t}\n \t}\n \treturn_value = stats->cnt_stats;\n \trte_spinlock_unlock(&stats->lock);\n", "prefixes": [ "dpdk-dev", "v1" ] }{ "id": 35305, "url": "