Commit: patch 9.1.1273: Coverity warns about using uninitialized value

1 view
Skip to first unread message

Christian Brabandt

unread,
Apr 3, 2025, 3:30:16 PM4/3/25
to vim...@googlegroups.com
patch 9.1.1273: Coverity warns about using uninitialized value

Commit: https://github.com/vim/vim/commit/f16d8b2dda077d8252c3f7d19e6a5bc15d1d51c1
Author: zeertzjq <zeer...@outlook.com>
Date: Thu Apr 3 21:21:15 2025 +0200

patch 9.1.1273: Coverity warns about using uninitialized value

Problem: Coverity warns about using uninitialized value
(after 9.1.1270).
Solution: Put an empty string in "buf" when allocation fails (zeertzjq).

closes: #17040

Signed-off-by: zeertzjq <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/buffer.c b/src/buffer.c
index 8277b726c..90ca59678 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4037,6 +4037,8 @@ maketitle(void)
vim_strncpy(buf, p, SPACE_FOR_FNAME);
vim_free(p);
}
+ else
+ STRCPY(buf, "");
}

#ifdef FEAT_TERMINAL
diff --git a/src/version.c b/src/version.c
index 28c024866..e00e0077c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1273,
/**/
1272,
/**/
Reply all
Reply to author
Forward
0 new messages