diff mbox

[2/3] libmultipath/parser.c: correctly terminate buffer

Message ID 1470727873-10502-3-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Hannes Reinecke Aug. 9, 2016, 7:31 a.m. UTC
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 mbox

Patch

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;