DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Jakub Grajciar <jgrajcia@cisco.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC v2] /net: memory interface (memif)
Date: Mon, 10 Dec 2018 10:42:51 +0000	[thread overview]
Message-ID: <7ebcd985-0d04-c0e1-5411-8e02c8bc72b2@intel.com> (raw)
In-Reply-To: <20181210100639.30244-1-jgrajcia@cisco.com>

On 10-Dec-18 10:06 AM, Jakub Grajciar wrote:
> Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
> ---

As a general comment, some description/cover letter would have been nice.

> +
> +	memif_msg_disconnect_t *d = &e->msg.disconnect;
> +
> +	e->msg.type = MEMIF_MSG_TYPE_DISCONNECT;
> +	d->code = err_code;
> +
> +	if (reason != NULL) {
> +		strncpy((char *)d->string, reason, strlen(reason));
> +		if (cc->pmd != NULL) {
> +			strncpy(cc->pmd->local_disc_string, reason,
> +				strlen(reason));
> +		}

I haven't looked at the entire thing, this is just something that caught 
my eye during quick skimming through code.

On the face of it, this looks dangerous - you're setting the destination 
buffer size from source buffer size. What if `d->string` is shorter than 
`reason`?


-- 
Thanks,
Anatoly

  reply	other threads:[~2018-12-10 10:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10  9:14 [dpdk-dev] [PATCH v3] eal_interrupts: add option for pending callback unregister Jakub Grajciar
2018-12-10  9:42 ` [dpdk-dev] [RFC] /net: memory interface (memif) Jakub Grajciar
2018-12-10 10:06 ` [dpdk-dev] [RFC v2] " Jakub Grajciar
2018-12-10 10:42   ` Burakov, Anatoly [this message]
2018-12-10 10:50     ` Richardson, Bruce
2018-12-12 10:19       ` Burakov, Anatoly
2018-12-12 10:30         ` Bruce Richardson
2018-12-10 14:48   ` Wiles, Keith
2018-12-10 15:13     ` Wiles, Keith
2018-12-17  4:26       ` Honnappa Nagarahalli
2018-12-17  4:54         ` Honnappa Nagarahalli
2018-12-10 16:20   ` Stephen Hemminger
2018-12-11  7:39   ` Ananyev, Konstantin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ebcd985-0d04-c0e1-5411-8e02c8bc72b2@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).