[PATCH libcacard 2/2] vscclient: help scan-build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



scan-build gives a false-positive error because it gets confused that
optarg may be NULL. Help him by adding an assert.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
Reported-by: Miroslav Rezanina <mrezanin@xxxxxxxxxx>
---
 src/vscclient.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/vscclient.c b/src/vscclient.c
index dd20842..0954b3f 100644
--- a/src/vscclient.c
+++ b/src/vscclient.c
@@ -679,6 +679,8 @@ main(
 #endif
 
     while ((c = getopt(argc, argv, "c:e:d:")) != -1) {
+        assert(optarg != NULL);
+
         switch (c) {
         case 'c':
             if (cert_count >= MAX_CERTS) {
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]