patch 9.1.1031: Coverity complains about insecure data handling
Problem: Coverity complains about insecure data handling
(v9.1.1024)
Solution: use int consistently to access the blob index
(Yegappan Lakshmanan)
related: #16468
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 5e0fd7d..bf3e889 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -4282,6 +4282,9 @@
call assert_equal(0zABBB0AABBB, str2blob(['«»', '«»'], {'encoding': 'latin1'}))
call assert_equal(0zC2ABC2BB, str2blob(['«»'], {'encoding': 'utf8'}))
+ call assert_equal(0z62, str2blob(["b"], test_null_dict()))
+ call assert_equal(0z63, str2blob(["c"], {'encoding': test_null_string()}))
+
call assert_fails("call str2blob(['abc'], [])", 'E1206: Dictionary required for argument 2')
call assert_fails("call str2blob(['abc'], {'encoding': []})", 'E730: Using a List as a String')
call assert_fails("call str2blob(['abc'], {'encoding': 'ab12xy'})", 'E1515: Unable to convert to ''ab12xy'' encoding')