[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] 01/04: equix: avoid a coverity warning in hashx_alloc()



This is an automated email from the git hooks/post-receive script.

dgoulet pushed a commit to branch main
in repository tor.

commit c71b6a14a391769261a08e96d0a1d90b5d1c9e11
Author: Micah Elizabeth Scott <beth@xxxxxxxxxxxxxx>
AuthorDate: Thu May 11 11:10:15 2023 -0700

    equix: avoid a coverity warning in hashx_alloc()
    
    This addresses one of the warnings in issue #40792. As far as I can tell
    this is a false positive, since the use of "ctx->type" in hashx_free()
    can only be hit after the unioned code/program pointer is non-NULL. It's
    no big deal to zero this value explicitly to silence the warning though.
    
    Signed-off-by: Micah Elizabeth Scott <beth@xxxxxxxxxxxxxx>
---
 src/ext/equix/hashx/src/context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ext/equix/hashx/src/context.c b/src/ext/equix/hashx/src/context.c
index de2144d46c..8548fb7ffa 100644
--- a/src/ext/equix/hashx/src/context.c
+++ b/src/ext/equix/hashx/src/context.c
@@ -41,6 +41,7 @@ hashx_ctx* hashx_alloc(hashx_type type) {
 		goto failure;
 	}
 	ctx->code = NULL;
+	ctx->type = 0;
 	if (type & HASHX_COMPILED) {
 		if (!hashx_compiler_init(ctx)) {
 			goto failure;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits