On Sun, Aug 24, 2008 at 7:26 AM, Jan Minář <[EMAIL PROTECTED]> wrote:
> On Sun, Aug 24, 2008 at 2:45 AM, Pınar Yanardağ <[EMAIL PROTECTED]> wrote:
>> After applying this patch to Vim 7.2, I got following errors while
>> trying to use K command (and shell also freezes after getting the
>> errors). I tried to reproduce them with a stable scenario, but
>> couldn't find a reasonable one. And also, K command sometimes works as
>> expected, too.
>
>> No manual entry for xml version="1.0" ?>
>>
>> shell returned 16
>
> This looks like you are visually selecting ``xml version="1.0" ?>'',
> and pressing K.  man says "No manual entry for <foo>", as it does,
> then returns 16.
>
>> Press ENTER or type command to continueVim: Caught deadly signal SEGV

Thanks for reporting this.  Forget my last email.  This is the fix:

       /*
        * Now grab the chars in the identifier
        */
 !     if (cmdchar == 'K' && !kp_help)
 !     {
 !      /* Sanitize properly */
-!      if ((p = vim_strsave_shellescape(ptr, TRUE)) == NULL ||
-!              (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1) == NULL)
+!      if ((p = vim_strsave_shellescape(ptr, TRUE)) == NULL)
 !          /* Out of memory */
 !          return;
+!      if ((buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1))
+!              == NULL)
+!      {
+!          /* Out of memory */
+!          /* XXX Print an Out of Memory error message here */
+!          vim_free(p);
+!          return;
+!      }
 !      STRCAT(buf, p);
 !      vim_free(p);
 !     }

The updated patch (version 3) attached.

Cheers,
Jan.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Attachment: K-arbitrary-command-execution.patch.v3
Description: Binary data

Raspunde prin e-mail lui