All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>,
	Hannes Reinecke <hare@suse.com>
Subject: [PATCH 2/3] libmultipath/parser.c: correctly terminate buffer
Date: Tue,  9 Aug 2016 09:31:12 +0200	[thread overview]
Message-ID: <1470727873-10502-3-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1470727873-10502-1-git-send-email-hare@suse.de>

The code would be returning a static NULL buffer instead of
terminating the original buffer.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 libmultipath/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/parser.c b/libmultipath/parser.c
index dd955f3..c47d891 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -171,7 +171,7 @@ snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, void *data)
 			r = kw->print(conf, buff + fwd, len - fwd, data);
 			put_multipath_config(conf);
 			if (!r) { /* no output if no value */
-				buff = '\0';
+				buff[0] = '\0';
 				return 0;
 			}
 			fwd += r;
-- 
2.6.6

  parent reply	other threads:[~2016-08-09  7:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09  7:31 [PATCH 0/3] Clang fixes Hannes Reinecke
2016-08-09  7:31 ` [PATCH 1/3] libmultipath/discovery.c: use 'unsigned long' instead of 'unsigned int' Hannes Reinecke
2016-08-09  7:31 ` Hannes Reinecke [this message]
2016-08-09  7:31 ` [PATCH 3/3] multipath: fixup check for out-of-scope maps Hannes Reinecke
2016-08-09 15:13 ` [PATCH 0/3] Clang fixes Christophe Varoqui

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=1470727873-10502-3-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=christophe.varoqui@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.com \
    --cc=xose.vazquez@gmail.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 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.