summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-16 18:38:24 +0200
committerStef Walter <stef@thewalter.net>2013-07-18 06:56:32 +0200
commit0ddd67184b65dfde0e5d05a957f01eeca161e384 (patch)
tree514973576159e468cd5408ac995ffa5e5ca74f04 /common
parentb2e6bc0ea2b2d2b90f6a159a23a4e676b1f302e4 (diff)
downloadp11-kit-0ddd67184b65dfde0e5d05a957f01eeca161e384.tar.gz
Make preconditions abort unconditionally when scanning with coverity
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
Diffstat (limited to 'common')
-rw-r--r--common/debug.c4
-rw-r--r--common/test.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/common/debug.c b/common/debug.c
index 1ef51d3..547ce2f 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -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 ();
}
diff --git a/common/test.c b/common/test.c
index b6ad012..c72cb7d 100644
--- a/common/test.c
+++ b/common/test.c
@@ -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);
}