All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH v2 4/5] target: split out helper for cxn timeout error stashing
Date: Fri, 12 Oct 2018 16:11:27 +0000	[thread overview]
Message-ID: <1539360687.249485.9.camel@acm.org> (raw)
In-Reply-To: <20181012100120.2365-5-ddiss@suse.de>

On Fri, 2018-10-12 at 12:01 +-0200, David Disseldorp wrote:
+AD4 +-void iscsit+AF8-fill+AF8-cxn+AF8-timeout+AF8-err+AF8-stats(struct iscsi+AF8-session +ACo-sess)
+AD4 +-+AHs
+AD4 +-	struct iscsi+AF8-portal+AF8-group +ACo-tpg +AD0 sess-+AD4-tpg+ADs
+AD4 +-	struct iscsi+AF8-tiqn +ACo-tiqn +AD0 tpg-+AD4-tpg+AF8-tiqn+ADs
+AD4 +-
+AD4 +-	if (+ACE-tiqn)
+AD4 +-		return+ADs
+AD4 +-
+AD4 +-	spin+AF8-lock+AF8-bh(+ACY-tiqn-+AD4-sess+AF8-err+AF8-stats.lock)+ADs
+AD4 +-	strcpy(tiqn-+AD4-sess+AF8-err+AF8-stats.last+AF8-sess+AF8-fail+AF8-rem+AF8-name,
+AD4 +-			sess-+AD4-sess+AF8-ops-+AD4-InitiatorName)+ADs

There have been too many problems with strcpy() and buffer overflows in the
past. If the source and destination strings both have the same size, please
add a BUILD+AF8-BUG+AF8-ON() statement that verifies that at compile time. If that
not's the case, how about using strlcpy() to make it easy for anyone who
reads the source code that no output buffer overflow will occur?

Thanks,

Bart.

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 10:01 [PATCH v2 4/5] target: split out helper for cxn timeout error stashing David Disseldorp
2018-10-12 16:11 ` Bart Van Assche [this message]
2018-10-13 13:34 ` David Disseldorp

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=1539360687.249485.9.camel@acm.org \
    --to=bvanassche@acm.org \
    --cc=target-devel@vger.kernel.org \
    /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.