84a0c0b
To: vim-dev@vim.org
84a0c0b
Subject: patch 7.1.020
84a0c0b
Fcc: outbox
84a0c0b
From: Bram Moolenaar <Bram@moolenaar.net>
84a0c0b
Mime-Version: 1.0
84a0c0b
Content-Type: text/plain; charset=ISO-8859-1
84a0c0b
Content-Transfer-Encoding: 8bit
84a0c0b
------------
84a0c0b
84a0c0b
Patch 7.1.020
84a0c0b
Problem:    Reading from uninitialized memory when using a dialog. (Dominique
84a0c0b
	    Pelle)
84a0c0b
Solution:   In msg_show_console_dialog() append a NUL after every appended
84a0c0b
	    character.
84a0c0b
Files:	    src/message.c
84a0c0b
84a0c0b
84a0c0b
*** ../vim-7.1.019/src/message.c	Thu May 10 18:49:39 2007
84a0c0b
--- src/message.c	Sun Jul  1 12:06:52 2007
84a0c0b
***************
84a0c0b
*** 3456,3466 ****
84a0c0b
  		    /* advance to next hotkey and set default hotkey */
84a0c0b
  #ifdef FEAT_MBYTE
84a0c0b
  		    if (has_mbyte)
84a0c0b
! 			hotkp += (*mb_ptr2len)(hotkp);
84a0c0b
  		    else
84a0c0b
  #endif
84a0c0b
  			++hotkp;
84a0c0b
! 		    (void)copy_char(r + 1, hotkp, TRUE);
84a0c0b
  		    if (dfltbutton)
84a0c0b
  			--dfltbutton;
84a0c0b
  
84a0c0b
--- 3456,3466 ----
84a0c0b
  		    /* advance to next hotkey and set default hotkey */
84a0c0b
  #ifdef FEAT_MBYTE
84a0c0b
  		    if (has_mbyte)
84a0c0b
! 			hotkp += STRLEN(hotkp);
84a0c0b
  		    else
84a0c0b
  #endif
84a0c0b
  			++hotkp;
84a0c0b
! 		    hotkp[copy_char(r + 1, hotkp, TRUE)] = NUL;
84a0c0b
  		    if (dfltbutton)
84a0c0b
  			--dfltbutton;
84a0c0b
  
84a0c0b
***************
84a0c0b
*** 3493,3499 ****
84a0c0b
  			*msgp++ = (dfltbutton == 1) ? ']' : ')';
84a0c0b
  
84a0c0b
  			/* redefine hotkey */
84a0c0b
! 			(void)copy_char(r, hotkp, TRUE);
84a0c0b
  		    }
84a0c0b
  		}
84a0c0b
  		else
84a0c0b
--- 3493,3499 ----
84a0c0b
  			*msgp++ = (dfltbutton == 1) ? ']' : ')';
84a0c0b
  
84a0c0b
  			/* redefine hotkey */
84a0c0b
! 			hotkp[copy_char(r, hotkp, TRUE)] = NUL;
84a0c0b
  		    }
84a0c0b
  		}
84a0c0b
  		else
84a0c0b
***************
84a0c0b
*** 3519,3526 ****
84a0c0b
  	    *msgp++ = ':';
84a0c0b
  	    *msgp++ = ' ';
84a0c0b
  	    *msgp = NUL;
84a0c0b
- 	    mb_ptr_adv(hotkp);
84a0c0b
- 	    *hotkp = NUL;
84a0c0b
  	}
84a0c0b
  	else
84a0c0b
  	{
84a0c0b
--- 3519,3524 ----
84a0c0b
***************
84a0c0b
*** 3555,3562 ****
84a0c0b
  	    msgp = confirm_msg + 1 + STRLEN(message);
84a0c0b
  	    hotkp = hotk;
84a0c0b
  
84a0c0b
! 	    /* define first default hotkey */
84a0c0b
! 	    (void)copy_char(buttons, hotkp, TRUE);
84a0c0b
  
84a0c0b
  	    /* Remember where the choices start, displaying starts here when
84a0c0b
  	     * "hotkp" typed at the more prompt. */
84a0c0b
--- 3553,3561 ----
84a0c0b
  	    msgp = confirm_msg + 1 + STRLEN(message);
84a0c0b
  	    hotkp = hotk;
84a0c0b
  
84a0c0b
! 	    /* Define first default hotkey.  Keep the hotkey string NUL
84a0c0b
! 	     * terminated to avoid reading past the end. */
84a0c0b
! 	    hotkp[copy_char(buttons, hotkp, TRUE)] = NUL;
84a0c0b
  
84a0c0b
  	    /* Remember where the choices start, displaying starts here when
84a0c0b
  	     * "hotkp" typed at the more prompt. */
84a0c0b
*** ../vim-7.1.019/src/version.c	Thu Jul  5 09:53:20 2007
84a0c0b
--- src/version.c	Thu Jul  5 10:09:34 2007
84a0c0b
***************
84a0c0b
*** 668,669 ****
84a0c0b
--- 668,671 ----
84a0c0b
  {   /* Add new patch number below this line */
84a0c0b
+ /**/
84a0c0b
+     20,
84a0c0b
  /**/
84a0c0b
84a0c0b
-- 
84a0c0b
BLACK KNIGHT:  Come on you pansy!
84a0c0b
    [hah] [parry thrust]
84a0c0b
    [ARTHUR chops the BLACK KNIGHT's right arm off]
84a0c0b
ARTHUR:        Victory is mine!  [kneeling]
84a0c0b
               We thank thee Lord, that in thy merc-
84a0c0b
    [Black Knight kicks Arthur in the head while he is praying]
84a0c0b
                                  The Quest for the Holy Grail (Monty Python)
84a0c0b
84a0c0b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
84a0c0b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
84a0c0b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
84a0c0b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///