]> granicus.if.org Git - p11-kit/commitdiff
Make preconditions abort unconditionally when scanning with coverity
authorStef Walter <stef@thewalter.net>
Tue, 16 Jul 2013 16:38:24 +0000 (18:38 +0200)
committerStef Walter <stef@thewalter.net>
Thu, 18 Jul 2013 04:56:32 +0000 (06:56 +0200)
This reflects that preconditions are invalid/unreachable on a
functioning system and with valid input. We do not try to recover
from such conditions.

In addition teach coverity about how our test suite fails

See http://p11-glue.freedesktop.org/doc/p11-kit/devel-building-style.html

https://bugzilla.redhat.com/show_bug.cgi?id=985005

common/debug.c
common/test.c

index 1ef51d3745bdce529462beb9c5afe0871f760ed9..547ce2fbff819f8c91c2d46dc3c8597b2c9045ae 100644 (file)
@@ -147,6 +147,10 @@ p11_debug_precond (const char *format,
        vfprintf (stderr, format, va);
        va_end (va);
 
+#ifdef __COVERITY__
+       fprintf (stderr, "ignoring P11_KIT_STRICT under coverity: %d", (int)debug_strict);
+#else
        if (debug_strict)
+#endif
                abort ();
 }
index b6ad01287266cfb77816bafdb7de0b563025bc1f..c72cb7d893a00000d46db3a747f6384d46e7006c 100644 (file)
@@ -122,6 +122,11 @@ p11_test_fail (const char *filename,
 
        free (output);
 
+       /* Let coverity know we're not supposed to return from here */
+#ifdef __COVERITY__
+       abort();
+#endif
+
        longjmp (gl.jump, 1);
 }