From 9054466e0e7a1720cd2dd00454ce145998a0e784 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Wed, 29 Mar 2023 20:36:37 +0200
Subject: [PATCH] starpu/tags: make sure we don't dereference NULL pointer

---
 runtime/starpu/control/runtime_tags.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/runtime/starpu/control/runtime_tags.c b/runtime/starpu/control/runtime_tags.c
index 32c481a0d..3030d12c5 100644
--- a/runtime/starpu/control/runtime_tags.c
+++ b/runtime/starpu/control/runtime_tags.c
@@ -165,6 +165,14 @@ chameleon_starpu_tag_release( int64_t min )
     cst_range_t *current = cst_first;
 
     assert( cst_first != NULL ); /* At least one range must be registered */
+    if ( current == NULL ) {
+#if defined(CHAMELEON_DEBUG_STARPU)
+        fprintf( stderr, "chameleon_starpu_tag: FAILED to release [%ld,...]\n",
+                 min );
+#endif
+
+        return;
+    }
 
     while ( (current != NULL) && (current->min < min) ) {
         prev    = current;
-- 
GitLab