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
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Index: screen.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/screen.c,v
retrieving revision 1.125
diff -c -r1.125 screen.c
*** screen.c 3 Nov 2009 16:36:17 -0000 1.125
--- screen.c 8 Nov 2009 13:12:45 -0000
***************
*** 6413,6419 ****
}
else
{
! nc = utfc_ptr2char(ptr + mbyte_blen, pcc);
nc1 = pcc[0];
}
pc = prev_c;
--- 6413,6420 ----
}
else
{
! nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc,
! (int)(text + len - ptr - mbyte_blen));
nc1 = pcc[0];
}
pc = prev_c;