Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/39889/?format=api
http://patches.dpdk.org/api/patches/39889/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/152608973466.121204.1661982833255592271.stgit@localhost.localdomain/", "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": "<152608973466.121204.1661982833255592271.stgit@localhost.localdomain>", "list_archive_url": "https://inbox.dpdk.org/dev/152608973466.121204.1661982833255592271.stgit@localhost.localdomain", "date": "2018-05-12T01:48:54", "name": "[dpdk-dev,v5,14/16] app/proc-info: sprintf overrun bug", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3ffb739b70dabf80b5d9a951eb69fb4605d14f34", "submitter": { "id": 1029, "url": "http://patches.dpdk.org/api/people/1029/?format=api", "name": "Andy Green", "email": "andy@warmcat.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/152608973466.121204.1661982833255592271.stgit@localhost.localdomain/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/39889/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/39889/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 3976E1CC57;\n\tSat, 12 May 2018 03:49:00 +0200 (CEST)", "from mail.warmcat.com (mail.warmcat.com [163.172.24.82])\n\tby dpdk.org (Postfix) with ESMTP id 5C7331CC57\n\tfor <dev@dpdk.org>; Sat, 12 May 2018 03:48:58 +0200 (CEST)" ], "From": "Andy Green <andy@warmcat.com>", "To": "dev@dpdk.org", "Date": "Sat, 12 May 2018 09:48:54 +0800", "Message-ID": "<152608973466.121204.1661982833255592271.stgit@localhost.localdomain>", "In-Reply-To": "<152608956198.121204.14844325841690943774.stgit@localhost.localdomain>", "References": "<152608956198.121204.14844325841690943774.stgit@localhost.localdomain>", "User-Agent": "StGit/unknown-version", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 14/16] app/proc-info: sprintf overrun bug", "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": "/home/agreen/projects/dpdk/app/proc-info/main.c: In function\n‘nic_xstats_display’:\n/home/agreen/projects/dpdk/app/proc-info/main.c:495:45:\nerror: ‘%s’ directive writing up to 255 bytes into a region\nof size between 165 and 232 [-Werror=format-overflow=]\n sprintf(buf, \"PUTVAL %s/dpdkstat-port.%u/%s-%s N:%\"\n ^~\n PRIu64\"\\n\", host_id, port_id, counter_type,\n ~~~~~~~~~~~~\n/home/agreen/projects/dpdk/app/proc-info/main.c:495:4: note:\n‘sprintf’ output between 31 and 435 bytes into a destination\nof size 256\n sprintf(buf, \"PUTVAL %s/dpdkstat-port.%u/%s-%s N:%\"\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n PRIu64\"\\n\", host_id, port_id, counter_type,\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n xstats_names[i].name, values[i]);\n\nSigned-off-by: Andy Green <andy@warmcat.com>\nFixes: 2deb6b5246d7 (\"app/procinfo: add collectd format and host id\")\nCc: stable@dpdk.org\n---\n app/proc-info/main.c | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)", "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 539e13243..c20effa4f 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -488,14 +488,18 @@ nic_xstats_display(uint16_t port_id)\n \t\tif (enable_collectd_format) {\n \t\t\tchar counter_type[MAX_STRING_LEN];\n \t\t\tchar buf[MAX_STRING_LEN];\n+\t\t\tsize_t n;\n \n \t\t\tcollectd_resolve_cnt_type(counter_type,\n \t\t\t\t\t\t sizeof(counter_type),\n \t\t\t\t\t\t xstats_names[i].name);\n-\t\t\tsprintf(buf, \"PUTVAL %s/dpdkstat-port.%u/%s-%s N:%\"\n+\t\t\tn = snprintf(buf, MAX_STRING_LEN,\n+\t\t\t\t\"PUTVAL %s/dpdkstat-port.%u/%s-%s N:%\"\n \t\t\t\tPRIu64\"\\n\", host_id, port_id, counter_type,\n \t\t\t\txstats_names[i].name, values[i]);\n-\t\t\tret = write(stdout_fd, buf, strlen(buf));\n+\t\t\tif (n > sizeof(buf) - 1)\n+\t\t\t\tn = sizeof(buf) - 1;\n+\t\t\tret = write(stdout_fd, buf, n);\n \t\t\tif (ret < 0)\n \t\t\t\tgoto err;\n \t\t} else {\n", "prefixes": [ "dpdk-dev", "v5", "14/16" ] }{ "id": 39889, "url": "