[lxc-devel] [lxc/master] Fix incorrect strncmp

flx42 on Github lxc-bot at linuxcontainers.org
Fri Jul 13 23:45:37 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 518 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180713/a28e00ac/attachment.bin>
-------------- next part --------------
From 24ff2dcca2a1cf1dca01c03bd3af13a5f6232809 Mon Sep 17 00:00:00 2001
From: Felix Abecassis <fabecassis at nvidia.com>
Date: Fri, 13 Jul 2018 16:41:23 -0700
Subject: [PATCH] Fix incorrect strncmp

Passing additional configuration options with "--define" was broken.

Result of git bisect:
d899f11b7bfb14c4b532bc801de89c8fb46307d4 is the first bad commit

Signed-off-by: Felix Abecassis <fabecassis at nvidia.com>
---
 src/lxc/confile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 4365264e9..d6eacf33b 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -2402,7 +2402,7 @@ static struct new_config_item *parse_new_conf_line(char *buffer)
 	line += lxc_char_left_gc(line, strlen(line));
 
 	/* martian option - don't add it to the config itself */
-	if (strncmp(line, "lxc.", strlen(line)))
+	if (strncmp(line, "lxc.", 4))
 		goto on_error;
 
 	ret = -1;


More information about the lxc-devel mailing list