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

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) ===
Signed-off-by: Christian Brauner <[email protected]>
From 6fbcbe3bd74043c8685aa7254915e87620494c66 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Tue, 20 Jun 2017 02:48:47 +0200
Subject: [PATCH] utils: use 1LU otherwise we overflow

Signed-off-by: Christian Brauner <[email protected]>
---
 src/lxc/utils.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index 4419e672e..9d88076c5 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -1923,12 +1923,14 @@ bool task_blocking_signal(pid_t pid, int signal)
                return bret;
 
        while (getline(&line, &n, f) != -1) {
-               if (!strncmp(line, "SigBlk:\t", 8))
-                       if (sscanf(line + 8, "%lx", &sigblk) != 1)
-                               goto out;
+               if (strncmp(line, "SigBlk:\t", 8))
+                       continue;
+
+               if (sscanf(line + 8, "%lx", &sigblk) != 1)
+                       goto out;
        }
 
-       if (sigblk & (1 << (signal - 1)))
+       if (sigblk & (1LU << (signal - 1)))
                bret = true;
 
 out:
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to