[patch] fixed read overflow in arabic mode

0 views
Skip to first unread message

Dominique Pellé

unread,
Nov 8, 2009, 3:17:40 PM11/8/09
to vim_dev
Hi

While testing Vim-7.2.284 with arabic mode, I noticed the
following error with Valgrind. Steps to reproduce are too
complex to describe here, but I can reproduce all the time:

==31786== Conditional jump or move depends on uninitialised value(s)
==31786== at 0x8120517: utfc_ptr2char (mbyte.c:1612)
==31786== by 0x816EDFB: screen_puts_len (screen.c:6416)
==31786== by 0x8103538: t_puts (message.c:2322)
==31786== by 0x810305A: msg_puts_display (message.c:2079)
==31786== by 0x81029CC: msg_puts_attr_len (message.c:1838)
==31786== by 0x8102009: msg_outtrans_len_attr (message.c:1402)
==31786== by 0x8101D31: msg_outtrans_len (message.c:1291)
==31786== by 0x80BB20A: draw_cmdline (ex_getln.c:2677)
==31786== by 0x80BBF64: redrawcmd (ex_getln.c:3163)
==31786== by 0x80C1146: ex_window (ex_getln.c:6243)
==31786== by 0x80B7EA3: getcmdline (ex_getln.c:736)
==31786== by 0x812D672: nv_search (normal.c:6138)
==31786== by 0x8125554: normal_cmd (normal.c:1188)
==31786== by 0x80E7A84: main_loop (main.c:1204)
==31786== by 0x80E7577: main (main.c:948)

Attached patch fixes it by using utfc_ptr2char_len(...) rather
than utfc_ptr2char(...) (as was already done a few lines above
in the same function).

Cheers
-- Dominique

fixed-read-overflow-screen.c-7.2.284.patch

Bram Moolenaar

unread,
Nov 9, 2009, 1:43:04 PM11/9/09
to Dominique Pellé, vim_dev

Dominique Pelle wrote:

Thanks!

--
"I love deadlines. I especially like the whooshing sound they
make as they go flying by."
-- Douglas Adams

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages