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

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,

Fix assignment of a signed value which has type 'int' to a variable of a bigger integer type 'size_t'

Thanks.

Signed-off-by: 2xsec <dh48.je...@samsung.com>
From 3a3dcd343249e546ae2a4bc5512de0fce9deb2fd Mon Sep 17 00:00:00 2001
From: 2xsec <dh48.je...@samsung.com>
Date: Wed, 11 Jul 2018 21:59:18 +0900
Subject: [PATCH] tools: lxc-ls: fix signed_to_bigger_unsigned issue

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

diff --git a/src/lxc/tools/lxc_ls.c b/src/lxc/tools/lxc_ls.c
index bba72e8d5..32278d498 100644
--- a/src/lxc/tools/lxc_ls.c
+++ b/src/lxc/tools/lxc_ls.c
@@ -308,7 +308,7 @@ static char *ls_get_config_item(struct lxc_container *c, 
const char *item,
        if (running)
                return c->get_running_config_item(c, item);
 
-       size_t len = c->get_config_item(c, item, NULL, 0);
+       int len = c->get_config_item(c, item, NULL, 0);
        if (len <= 0)
                return NULL;
 
@@ -316,7 +316,7 @@ static char *ls_get_config_item(struct lxc_container *c, 
const char *item,
        if (!val)
                return NULL;
 
-       if ((size_t)c->get_config_item(c, item, val, len + 1) != len) {
+       if (c->get_config_item(c, item, val, len + 1) != len) {
                free(val);
                val = NULL;
        }
@@ -612,7 +612,7 @@ static int ls_get(struct ls **m, size_t *size, const struct 
lxc_arguments *args,
 
 static char *ls_get_cgroup_item(struct lxc_container *c, const char *item)
 {
-       size_t len = c->get_cgroup_item(c, item, NULL, 0);
+       int len = c->get_cgroup_item(c, item, NULL, 0);
        if (len <= 0)
                return NULL;
 
@@ -620,7 +620,7 @@ static char *ls_get_cgroup_item(struct lxc_container *c, 
const char *item)
        if (!val)
                return NULL;
 
-       if ((size_t)c->get_cgroup_item(c, item, val, len + 1) != len) {
+       if (c->get_cgroup_item(c, item, val, len + 1) != len) {
                free(val);
                val = NULL;
        }
@@ -630,7 +630,7 @@ static char *ls_get_cgroup_item(struct lxc_container *c, 
const char *item)
 
 static char *ls_get_groups(struct lxc_container *c, bool running)
 {
-       size_t len = 0;
+       int len = 0;
        char *val = NULL;
 
        if (running)
@@ -640,7 +640,7 @@ static char *ls_get_groups(struct lxc_container *c, bool 
running)
 
        if (!val && (len > 0)) {
                val = malloc((len + 1) * sizeof(*val));
-               if ((size_t)c->get_config_item(c, "lxc.group", val, len + 1) != 
len) {
+               if (c->get_config_item(c, "lxc.group", val, len + 1) != len) {
                        free(val);
                        return NULL;
                }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to