Yegappan wrote:

> When generating a spell file using the ":mkspell" command,
> I am running into a heap buffer overflow (with the ASAN build):
> 
> To reproduce this problem, save the following content to
> a file (x.vim):
> -------------------------------------------------------------------------------------
> call writefile(['1', 'work'], 'Xtest.dic')
> call writefile(['SOFOFROM abcd', 'SOFOTO ABCD', 'SAL CIA X'], 'Xtest.aff')
> mkspell! Xtest.spl Xtest
> -------------------------------------------------------------------------------------
> 
> Now run the command "vim --clean -N -u NONE -i NONE -S x.vim"

I can also find it with valgrind.

Looks like we need to remember the length of the bytes buffer, so we can
avoid going over the end.


-- 
Ten bugs in the hand is better than one as yet undetected.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202008241802.07OI2ZdI1290096%40masaka.moolenaar.net.

Raspunde prin e-mail lui