[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 4b2364: Protect buffer underflow

GitHub noreply at github.com
Thu Dec 27 14:17:58 UTC 2018


  Branch: refs/heads/win64_cleanups
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 4b23645c1ccff7cbd4d8bb8e01fb950efd295ad2
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4b23645c1ccff7cbd4d8bb8e01fb950efd295ad2
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-25 (Tue, 25 Dec 2018)

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

  Log Message:
  -----------
  Protect buffer underflow

Path could be shorted than 4 chars eventually...


  Commit: e9bfeefc03b7a908b2925a9c474a59b9b9ad7d1b
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e9bfeefc03b7a908b2925a9c474a59b9b9ad7d1b
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-25 (Tue, 25 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c

  Log Message:
  -----------
  Make icon setting 64bits compatible

Casting the icon handle (size of a pointer) to LONG (32 bits) is not 64bits friendly


  Commit: 8df05ee8a333d24e76d7956a9ef4d73bd120b4bb
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8df05ee8a333d24e76d7956a9ef4d73bd120b4bb
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-25 (Tue, 25 Dec 2018)

  Changed paths:
    M platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c

  Log Message:
  -----------
  remove a warning about a control path not returning a value


  Commit: b2a8bd8d8beddebbcb128c5b39740e8a94c16763
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b2a8bd8d8beddebbcb128c5b39740e8a94c16763
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-25 (Tue, 25 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c

  Log Message:
  -----------
  Use TEXT macro for generic (ASCII or WIDE) string method

We should either use

- explicit  ASCII variant with ASCII String constant `CertOpenSystemStoreA(0 , "MY")`
- explicit  WIDE variant with Wide String constant `CertOpenSystemStoreW(0 , L"MY")`
- generic variant with generic TEXT constant `CertOpenSystemStore(0 , TEXT("MY"))`

But we should not mix usage of whatever variant function with whatever variant String.<br>
See https://docs.microsoft.com/en-us/windows/desktop/api/winnt/nf-winnt-text

Otherwise, in absence of `-DUNICODE`compiler flag, the compiler barks:

     ../../platforms/win32/plugins/SqueakSSL/sqWin32SSL.c:176:35: warning: incompatible pointer types passing 'unsigned short [3]' to parameter of type 'LPCSTR' (aka 'const char *') [-Wincompatible-pointer-types]
              hStore = CertOpenSystemStore(0, L"MY");
                                              ^~~~~
    /usr/x86_64-w64-mingw32/sys-root/mingw/include/wincrypt.h:4432:83: note: passing argument to parameter 'szSubsystemProtocol' here
      WINIMPM HCERTSTORE WINAPI CertOpenSystemStoreA (HCRYPTPROV_LEGACY hProv, LPCSTR szSubsystemProtocol);


  Commit: a08c1fec2bd75375e5c389eb5e0b706eaa62c82f
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/a08c1fec2bd75375e5c389eb5e0b706eaa62c82f
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-26 (Wed, 26 Dec 2018)

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

  Log Message:
  -----------
  Provides a high resolution clock for MSVC

See https://msdn.microsoft.com/en-us/library/ms644904(v=VS.85).aspx


  Commit: 57d09aebf6b45f6b2cce6659f70946e8c9a38d2c
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/57d09aebf6b45f6b2cce6659f70946e8c9a38d2c
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-26 (Wed, 26 Dec 2018)

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

  Log Message:
  -----------
  Define some UNIX constants in sqWin32Directory.c, MSVC oblige

the unix constants S_IRUSR are not defined in MSVC.
Pick the workaround from platforms/minheadless/windows/sqWin32Directory.c


  Commit: ad71bd01659a5b909a2f744361a660c6a53a00b3
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ad71bd01659a5b909a2f744361a660c6a53a00b3
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-26 (Wed, 26 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/SqueakSSL/sqWin32SSL.c

  Log Message:
  -----------
  Remove a few printf warnings


  Commit: 8c04d9af6c308207399849a516aaf91d1b5f33e8
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8c04d9af6c308207399849a516aaf91d1b5f33e8
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-26 (Wed, 26 Dec 2018)

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

  Log Message:
  -----------
  Prefer DirectX8 in MSVC

Note that support for DirectX-7 is not available after 2007 SDK!!!
https://blogs.msdn.microsoft.com/chuckw/2012/08/21/directx-sdks-of-a-certain-age/
We are showing our age...

cygwin still provide support files for DirectX-7, but DirectX-8 does not compile out of the box, so stick to 7 outside MSVC.


  Commit: e0d70a91864eca8f72947fe36d1865785482ed2e
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/e0d70a91864eca8f72947fe36d1865785482ed2e
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c

  Log Message:
  -----------
  Workaround S_ISFIFO to let MSVC compile FilePlugin

Note: there is a possibility to create named pipe in windows
https://docs.microsoft.com/en-us/windows/desktop/ipc/named-pipes

But named pipes cannot be intermixed with regular files.
They are mounted on special named pipe file system (NPFS)
https://stackoverflow.com/questions/21139790/where-on-windows-a-named-pipe-file-is-stored
So I think that answering false to the query is a good solution.


  Commit: 9aea67d0dd63a191e80f69c6e760aadaf72de763
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9aea67d0dd63a191e80f69c6e760aadaf72de763
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32Backtrace.c
    M platforms/win32/vm/sqWin32Threads.c

  Log Message:
  -----------
  Backport Unicode compatibility patches from minheadless variant


  Commit: f6d2d56b091be1b25310128b228c48c968114d60
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f6d2d56b091be1b25310128b228c48c968114d60
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/SoundPlugin/sqWin32Sound.c

  Log Message:
  -----------
  Yet another printLastError Unicode compatibility fix in SoundPlugin


  Commit: 67980fcf86460ac508b2beaf4a39cef58040ccdf
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/67980fcf86460ac508b2beaf4a39cef58040ccdf
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32PluginSupport.c
    M platforms/win32/vm/sqWin32Threads.c
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Fix another bunch of usage of printLastError uncompatible with Unicode


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/4b23645c1ccf^...67980fcf8646
      **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.


More information about the Vm-dev mailing list