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

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 "Explicit null dereferenced".

This is false positive because the optarg value is not null.

But coverity can not detect this. So, I add a contidtion to avoid this case.

Thanks.

Signed-off-by: 2xsec <dh48.je...@samsung.com>
From f766a9d22b3d7a847b5bc400d9d87247782001fb Mon Sep 17 00:00:00 2001
From: 2xsec <dh48.je...@samsung.com>
Date: Mon, 2 Jul 2018 20:37:36 +0900
Subject: [PATCH] coverity: #1425816

Explicit null dereferenced

Signed-off-by: 2xsec <dh48.je...@samsung.com>
---
 src/tests/concurrent.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/tests/concurrent.c b/src/tests/concurrent.c
index 6804bec54..c41e9f48f 100644
--- a/src/tests/concurrent.c
+++ b/src/tests/concurrent.c
@@ -175,6 +175,9 @@ int main(int argc, char *argv[]) {
         case 'm': {
             char *mode_tok, *tok, *saveptr = NULL;
 
+           if (!optarg)
+                continue;
+
             modes = NULL;
             for (i = 0, mode_tok = optarg;
                  (tok = strtok_r(mode_tok, ",", &saveptr));
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to