Loading ...
Sorry, an error occurred while loading the content.

Re: Usage of GetUserName in os_win32.c

Expand Messages
  • Bram Moolenaar
    ... Thanks for reporthing this. I ll make a patch. -- It might look like I m doing nothing, but at the cellular level I m really quite busy. /// Bram
    Message 1 of 2 , Oct 1, 2007
    • 0 Attachment
      Alexei Alexandrov wrote:

      > Hi Vimmers,
      >
      > In file os_win32.c there is a function mch_get_user_name() which uses
      > GetUserName() function to get the logon name on Windows. The constant
      > used to declare a buffer to get the name is MAX_COMPUTERNAME_LENGTH
      > which is not correct. The correct constant (as mentioned in the
      > documentation) is UNLEN.
      >
      > I don't know the severity of this problem, but note that UNLEN is 256
      > characters, while MAX_COMPUTERNAME_LENGTH is only 15 characters.
      >
      > In fact, I discovered this problem while looking into BoundsChecker
      > results for Vim - my logon name is longer than 15 chars and
      > GetUserName were failing. Still, I can work in Vim perfectly - so this
      > bug doesn't affect most of us.

      Thanks for reporthing this. I'll make a patch.

      --
      It might look like I'm doing nothing, but at the cellular level
      I'm really quite busy.

      /// Bram Moolenaar -- Bram@... -- 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 ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.