[master] a5810d25d Coverity: Explain vtc_logfail()

Nils Goroll nils.goroll at uplex.de
Thu Sep 12 09:41:05 UTC 2024


commit a5810d25d00eaaa97f551a52bb03139c4d610cc8
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Sep 12 11:37:55 2024 +0200

    Coverity: Explain vtc_logfail()
    
    It seems coverity does not grok vtc_logfail() via vtc_fatal() as panic-ish,
    because it complains about a possible overflow for l in
    
            if (signed <= 0)
                    vtc_fatal(...)
            l -= signed;
    
    Ref CID 1605325

diff --git a/bin/varnishtest/vtc_log.c b/bin/varnishtest/vtc_log.c
index 5fa44e7be..26bb7302e 100644
--- a/bin/varnishtest/vtc_log.c
+++ b/bin/varnishtest/vtc_log.c
@@ -109,6 +109,13 @@ vtc_logclose(void *arg)
 	FREE_OBJ(vl);
 }
 
+#ifdef __COVERITY__
+static void v_noreturn_
+vtc_logfail(void)
+{
+	__coverity_panic__();
+}
+#else
 static void v_noreturn_
 vtc_logfail(void)
 {
@@ -119,6 +126,7 @@ vtc_logfail(void)
 	else
 		exit(fail_out());
 }
+#endif
 
 static const char * const lead[] = {
 	"----",


More information about the varnish-commit mailing list