patch 9.1.1041: Vim9: out-of-bound access when echoing an enum

Problem:  Vim9: out-of-bound access when echoing an enum
Solution: Add NUL to growarray, check that ufunc is non-null
          before accessing it to make Coverity happy
          (Yegappan Lakshmanan)

closes: #16488

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9class.c b/src/vim9class.c
index c3ccf02..e847bf0 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -4054,6 +4054,7 @@
 	vim_free(ga.ga_data);
 	return NULL;
     }
+    ga_append(&ga, NUL);
     return (char_u *)ga.ga_data;
 }