Commit graph

3 commits

Author SHA1 Message Date
Marc Durdin
fe2c1cd187 fix(windows): incxstr could run over buffer with malformed data
Fixes #4591.

I fixed incxstr in 4 places:

1. Common/Core: kmx_xstring.cpp
2. Engine: xstring.cpp
3. Test project importkeyboard importkeyboard.cpp
4. Test project m-to-p m-to-p.cpp

I updated mcompile to remove its own copy of incxstr (identical to that
in xstring.cpp) to reduce WETness but opted not to do so for the test
apps, which are pretty much throwaway anyway.

I note that there is more work we could do here; we need to check every
character as we increment so we don't miss a `U+0000` end of string with
malformed data. But I would like to tackle that as a separate job at
some point in the future after Core integration.
2021-03-05 12:50:29 +11:00
Marc Durdin
d5790ca9b6 fix(windows): cleanup pointer to int typecasts
Fixes #3084.

This does two things:

1. Cleans up a bunch of places where we used to use `(int)` typecasts
   for pointer math, which was problematic. We now use `(INT_PTR)` per
   MSDN https://docs.microsoft.com/en-us/windows/win32/winprog64/rules-for-using-pointers
   and then cast that down to `(int)` where necessary, e.g. when storing
   string lengths which are never going to be more than a few hundred
   characters! Doing this explicitly helps to clarify that we are aware
   of the typecast and believe it to be safe.

2. Adds in some build infrastructure for future use of Coverity Scan
   https://scan.coverity.com/ which we plan to use for further code
   quality updates. I have submitted the project to Coverity and are
   now waiting for approval so we can check results. Once we have
   approval, I do plan to add this to the nightly build (we need to
   keep submissions under 3 builds/day).

   Note: I have not yet added Keyman Core (Windows) to this project,
   nor are we currently building Keyman Core (macOS) or Keyman for
   Linux, but we should consider adding those in future.
2020-09-24 14:39:59 +10:00
Marc Durdin
b65b982584 Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121)
* Keyman for Windows 10.0 Open Source

* Squashed 'windows/src/ext/jedi/jedi/' content from commit f444ad2

git-subtree-dir: windows/src/ext/jedi/jedi
git-subtree-split: f444ad2da4693851e523f1ea6bd541f701904c24

* Squashed 'windows/src/ext/jedi/jcl/' content from commit d63d3c9fd

git-subtree-dir: windows/src/ext/jedi/jcl
git-subtree-split: d63d3c9fd9ff84efdd8159084ec6a60313644243

* Squashed 'windows/src/ext/jedi/jvcl/' content from commit bee19f3b4

git-subtree-dir: windows/src/ext/jedi/jvcl
git-subtree-split: bee19f3b46909fde2fa92c06cd2706f41d99f6c3

* Add required .res files

* Add required .res files

* Add docbook files (forced)

* Add required libxslt

* Add required jedi files

* Add installation files

* Tweak .gitignore for open

* CI

* Remove KMW from Developer source (#122)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Fixup release build and copy license, readme from kmw during build

* Remove obsolete build help documentation

* Keyman Engine 10 on Windows regression for shift states (#129)

* Improve #128 -- cleaner debug messages

* Fixes #127, shift state now resets correctly; and more work for #128

* Fixes #130 (#131)
2017-07-25 10:53:06 +07:00