All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xywang.sjtu@sjtu.edu.cn
Cc: aelior@marvell.com, GR-everest-linux-l2@marvell.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net/ethernet/qlogic/qed: force the string buffer NULL-terminated
Date: Fri, 02 Aug 2019 17:57:33 -0700 (PDT)	[thread overview]
Message-ID: <20190802.175733.1007297377658559404.davem@davemloft.net> (raw)
In-Reply-To: <20190731081542.14178-1-xywang.sjtu@sjtu.edu.cn>

From: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Date: Wed, 31 Jul 2019 16:15:42 +0800

> strncpy() does not ensure NULL-termination when the input string
> size equals to the destination buffer size 30.
> The output string is passed to qed_int_deassertion_aeu_bit()
> which calls DP_INFO() and relies NULL-termination.
> 
> Use strlcpy instead. The other conditional branch above strncpy()
> needs no fix as snprintf() ensures NULL-termination.
> 
> This issue is identified by a Coccinelle script.
> 
> Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>

Applied.

      reply	other threads:[~2019-08-03  0:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  8:15 [PATCH] net/ethernet/qlogic/qed: force the string buffer NULL-terminated Wang Xiayang
2019-08-03  0:57 ` David Miller [this message]

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=20190802.175733.1007297377658559404.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=xywang.sjtu@sjtu.edu.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.