updated for version 7.3.160
Problem: Unsafe string copying.
Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead
of strcat().
diff --git a/src/misc1.c b/src/misc1.c
index 97e29c2..f09a5bd 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3332,19 +3332,23 @@
if (pn == 1)
{
if (n > 0)
- STRCPY(msg_buf, _("1 more line"));
+ vim_strncpy(msg_buf, (char_u *)_("1 more line"),
+ MSG_BUF_LEN - 1);
else
- STRCPY(msg_buf, _("1 line less"));
+ vim_strncpy(msg_buf, (char_u *)_("1 line less"),
+ MSG_BUF_LEN - 1);
}
else
{
if (n > 0)
- sprintf((char *)msg_buf, _("%ld more lines"), pn);
+ vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
+ _("%ld more lines"), pn);
else
- sprintf((char *)msg_buf, _("%ld fewer lines"), pn);
+ vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
+ _("%ld fewer lines"), pn);
}
if (got_int)
- STRCAT(msg_buf, _(" (Interrupted)"));
+ vim_strcat(msg_buf, (char_u *)_(" (Interrupted)"), MSG_BUF_LEN);
if (msg(msg_buf))
{
set_keep_msg(msg_buf, 0);