The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2402

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Hello,

I'm sorry. I didn't check it before pull request.

Uninitialized pointer

Thanks.

Signed-off-by: 2xsec <dh48.je...@samsung.com>
From a5452e50b2106d86ffbe0094680fea6ce1db23e4 Mon Sep 17 00:00:00 2001
From: 2xsec <dh48.je...@samsung.com>
Date: Thu, 14 Jun 2018 22:55:47 +0900
Subject: [PATCH] coverity: #1437017

Uninitialized pointer

Signed-off-by: 2xsec <dh48.je...@samsung.com>
---
 src/lxc/cmd/lxc_user_nic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/cmd/lxc_user_nic.c b/src/lxc/cmd/lxc_user_nic.c
index a4a5b857e..8ec6045b9 100644
--- a/src/lxc/cmd/lxc_user_nic.c
+++ b/src/lxc/cmd/lxc_user_nic.c
@@ -192,6 +192,8 @@ static char **get_groupnames(void)
                return NULL;
        }
 
+       memset(groupnames, 0, sizeof(char *) * (ngroups + 1));
+
        bufsize = sysconf(_SC_GETGR_R_SIZE_MAX);
        if (bufsize == -1)
                bufsize = 1024;
@@ -206,8 +208,6 @@ static char **get_groupnames(void)
                return NULL;
        }
 
-       memset(groupnames, 0, sizeof(char *) * (ngroups + 1));
-
        for (i = 0; i < ngroups; i++) {
                ret = getgrgid_r(group_ids[i], &grent, buf, bufsize, &grentp);
                if (!grentp) {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to