Problem: potential buffer overrun in bufwrite.c
Solution: Use a temporary variable (John Marriott)
In my Windows 11 Pro 64-bit build MAXPATHL is 1024 and IOSIZE is 1025.
In my Archlinux Linux 64-bit build MAXPATHL is 4096 and IOSIZE is 1025.
In funuction buf_write():
There is a check (line 713) that makes sure the length of fname is less
than MAXPATHL. There is a call to STRCPY() (line 1208) which copies the
string at fname into IObuff (which has size IOSIZE). For Unix builds
fname is set to sfname which may or may not be shorter. However, if
sfname is NULL sfname is set to fname.
Therefore, in builds where MAXPATHL > IOSIZE (eg in my linux build), it
is theoretically possible for the STRCPY() call to exceed the bounds of
IObuff.
This PR addresses this by copying fname into a local variable that has
the same maximum size as fname.
In addition:
Given that the filename is unconditionally overwritten in the for loop,
only copy the directory portion of fname. Move variable i closer to
where it is used.
closes: #18095
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
config filetype, fall back to POSIX m4 (Damien Lejay).
closes: #18065
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Adds the lf release 37 specific syntax highlighting changes.
From the PR andis-sprinkis/lf-vim#23 by @CatsDeservePets
closes: #18115
Signed-off-by: Andis Spriņķis <andis@sprinkis.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_ruby: unknown pragma when not using gcc
Solution: only use GCC pragma, when using GCC
(Cthulhux)
fixes: #18109closes: #18110
Signed-off-by: Cthulhux <github@tuxproject.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: min()/max() does not handle float data types
(ubaldot)
Solution: Extend min() and max() to every comparable type
(LemonBoy)
Re-use the logic used for plain old comparison operators, this way we
gain support for float values and unify the logic handling the
comparisons.
fixes: #18052
closes: 18055
Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_wildtrigger_update_screen() creates an unused
mapping (after 9.1.1621).
Solution: Remove the mapping. Also use blank lines more consistently in
test_cmdline.vim screendump tests (zeertzjq).
closes: #18096
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: no test for actually moving cursor when menu is not
open with 'autocompletedelay'.
Solution: Use <Up> first in the test. Also remove two unnecessary <Esc>s
in completion timeout test (zeertzjq).
closes: #18097
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: possible buffer-under run in if_cscope
cs_pathcomponents() (Murali Aniruddhan)
Solution: Fix the loop and do not decrement the pointer twice.
closes: #18091
Signed-off-by: Christian Brabandt <cb@256bit.org>
There are really two issues solved here:
- The directory listing was not populating the new buffer when using
the :Explore command. This was because the directory to open is
determined by using expand("%:p") which includes '!/running/command' at
the end of the string in terminal buffers.
- The :Explore command should replace the buffer, not split it. This
because the Explore command will automatically split if the current
buffer has been modified. According to the docs, all terminal buffers
will have the modified flag set when a job is running.
fixes: #9862closes: #18069
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Amiga: cannot handle large undo files
Solution: Remove the existing restriction as it was only valid for
classic Amiga (Damien Lejay).
It seems that this block was only relevant for classic AmigaOS (< 32K
alloc limit). And it seems to no longer apply: AmigaOS 4.0 switched to
a slab allocator memory system.
closes: #18072
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: wrong ifdef in message.c
Solution: change it to #ifndef MSWIN (Damien Lejay)
The extra newline on screen switch is needed for all TTY/termcap
backends (Unix, VMS, others).
Only Windows uses a different console API.
Better use #ifndef MSWIN to express the real intent.
closes: #18076
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
bash 5.3 (released July 2025) added support for ${ cmd;} and
${|cmd;} style command substitution, which is similar (but not
identical) to ksh/mksh.
closes: #18084
Signed-off-by: Kevin Pulo <kevin.pulo@mongodb.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: Makefiles can be refactored
Solution: Refactor using a common tools.mak, make some style changes
(RestorerZ).
closes: #18060
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_python: still support for Python 1
Solution: Drop outdated code (Hirohito Higashi)
closes: #18092
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim script: no support for URI de-/encoding
(ubaldot)
Solution: Add the uri_encode() and uri_decode() functions
(Yegappan Lakshmanan)
fixes: #17861closes: #18034
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: items() does not work for Blobs
Solution: Extend items() to support Blob
(Yegappan Lakshmanan).
closes: #18080
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Another outdated comment in eval.c (after 9.1.1665).
Solution: Remove that comment as well. Add a few more tests for mapnew()
that fail without patch 8.2.1672 (zeertzjq).
closes: #18089
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: no support for terminal primary device attributes
Solution: Add support for detecting the DA1 response from the terminal,
add the v:termda1 variable and the 't_Ms' option for the
OSC 52 command format (Foxe Chen)
closes: #18033
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Outdated comment in eval.c.
Solution: Remove the comment, which is no longer true after 8.2.1672.
Also fix a typo in version9.txt (zeertzjq).
closes: #18077
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: configure: can use any autocon
Solution: Use AC_PREREQ and require 2.71 (Damien Lejay)
technically, we require autoconf 2.72, but that is not available on
Ubuntu LTS 24.04. So let's go with 2.71 for now and add a comment about
it in configure.ac
closes: #18047
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- all colorschemes were ported to colortemplate v3
- gui versions of habamax, lunaperche, wildcharm, retrobox colorschemes
have different Diff, Visual, Search and IncSearch colors compared to non-gui.
- habamax Search was changed to green instead of blue to better distinct
it with Visual (also bluish in gui)
closes: #18061
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: xxd: 9.1.0023 introduced additional dependency
Solution: remove non-native z/OS library call (David Seal)
Commit 48a75f3dfb (Patch 9.1.0023)
introduces a call to __disableautocvt() which can only be found in a
non-native z/OS library. This requires installing the external zoslib
library in order to work, which is not present on all z/OS systems
So remove the call to __disableautocvt() and rely on library routines
that are available to all z/OS users
See https://ibmruntimes.github.io/zoslib/zos-io_8cc.html for more
details
closes: #18059
Signed-off-by: David Seal <dseal@rocketsoftware.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Issues with proto files: missing or inconsistent prototypes.
Solution: Update ifdefs, move typedefs, fix prototype declaration
(Hirohito Higashi)
This change focuses on fixes and tweaks found while working on #18045 for
the proto/*.pro files.
The following fixes and tweaks have been made:
- Fixed a prototype declaration where the variable name differed from
the function definition.
- Removed a prototype declaration without a function body.
- Fixed a problem where a prototype declaration was not created for a
function definition enclosed in a #if directive because it lacked ||
defined(PROTO).
- Moved typedef struct soundcb_S soundcb_T; from proto/sound.pro to
vim.h.
- Other small tweaks.
The make proto mechanism remains unchanged.
closes: #18058
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity finds a few issues in clientserver.c
(also by Tony Mechelynck)
Solution: Fix issues and warnings (Foxe Chen)
closes: #18057
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Popups without border/padding/title don't flip position when
cursor is near bottom of screen, while decorated popups do
flip correctly.
Solution: Use original height instead of truncated height for position
inversion check, except for info popups to preserve existing
behavior (glepnir).
fixes: #12546closes: #18054
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Missing includes for Wayland headers, when subfolder is used
(after v9.1.1644)
Solution: Add new $WAYLAND_CPPFLAGS (Christoffer Aasted).
closes: #18051
Signed-off-by: Christoffer Aasted <dezzadk@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The returned value is only in arbitrary order for a Dict.
closes: #18050
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: build failure when FEAT_DIFF is not defined
(John Marriott)
Solution: Remove FEAT_DIFF in proto.h; define dummy type for
diffline_T and diffline_change_T when FEAT_DIFF is not defined
related: #18026closes: #18046
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains about Null pointer dereference
(after v9.1.1643)
Solution: Check that TabPageIdx is not Null
Signed-off-by: Christian Brabandt <cb@256bit.org>