[OpenSmalltalk/opensmalltalk-vm] 3e5161: fixup: skip only 18 WCHAR if keyName begins with \...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] 3e5161: fixup: skip only 18 WCHAR if keyName begins with \...

Eliot Miranda-3
 
  Branch: refs/heads/WIN64_UNICODE
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 3e51616a56a0ef49b7c67a580db0f0fbaaea588f
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3e51616a56a0ef49b7c67a580db0f0fbaaea588f
  Author: Nicolas Cellier <[hidden email]>
  Date:   2019-01-02 (Wed, 02 Jan 2019)

  Changed paths:
    M platforms/win32/vm/sqWin32Main.c

  Log Message:
  -----------
  fixup: skip only 18 WCHAR if keyName begins with \\registry\\machine

Note that keyName was declared char * in the original code.
But now it is WCHAR*, so keyName+18 already does the right thing (skip 18 char) while modified code would now skip 36!
Note that original code was using memcpy for this case of overlapping memory which is BAD and eventually UB.
[skip travis]



      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.