From 3056419608d5e1835d41612e09b56511d0f9a101 Mon Sep 17 00:00:00 2001 From: ShyamsundarR Date: Wed, 7 Nov 2018 15:17:55 -0500 Subject: coverity: ignore tainted access reported in gf_free Earlier commit had the annotation incorrect, and also did not wrap the sanitization in a separate function. (see commit 39a1db1) The issues are corrected in this patch, and also a coverity stand alone run has been tested to ensure the annotations are respected by coverity. Change-Id: I4a93b6981e2ff4bba9a29e590b17da248931c8ae Updates: bz#789278 Signed-off-by: ShyamsundarR --- libglusterfs/src/mem-pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index caf8bf2fa0c..16e413e22f2 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -309,7 +309,12 @@ If the pointer is accessed outside the scope of this function without any checks on content read from an IO operation, taints will still be reported, and needs appropriate addressing. */ -/* coverity[ +tainted_string_sanitize_content : arg-0 ] */ +/* coverity[ +tainted_data_sanitize : arg-0 ] */ +static void +gf_free_sanitize(void *s) +{ +} + void __gf_free(void *free_ptr) { @@ -325,6 +330,7 @@ __gf_free(void *free_ptr) if (!free_ptr) return; + gf_free_sanitize(free_ptr); ptr = free_ptr - GF_MEM_HEADER_SIZE; header = (struct mem_header *)ptr; -- cgit