1. 04 Dec, 2017 2 commits
    • Harris Hancock's avatar
      c137c9fd
    • Harris Hancock's avatar
      decodeBase64() reports errors required by HTML spec · f3e0ed22
      Harris Hancock authored
      This change modifies decodeBase64() to report errors as required by the WHATWG HTML spec's atob() JavaScript function. Notably, it reports errors for non-whitespace characters outside of the valid base64 character range ([+/0-9A-Za-z=]), and performs sanity checks on padding and input length.
      
      I took care to keep the algorithm single-pass, and to support streaming via multiple calls of base64_decode_block(), though we don't currently expose that functionality.
      f3e0ed22
  2. 02 Dec, 2017 1 commit
  3. 23 Nov, 2017 2 commits
  4. 21 Nov, 2017 2 commits
  5. 20 Nov, 2017 2 commits
    • Davide Italiano's avatar
    • Harris Hancock's avatar
      capnp_generate_cpp: Fix input file existence check · ae8859ce
      Harris Hancock authored
      capnp_generate_cpp() checks that input schema files exist at configure-time, and reports a fatal error if they don't exist. However, the check prepended the value of CAPNPC_SRC_PREFIX to input file paths, which is the wrong thing to do: the input file paths should be checked as-is if they are absolute paths, and checked relative to the current source directory, NOT the value of capnp's src-prefix flag, if they are relative paths, in order to match the capnp tool's behavior.
      
      It turns out that it's easiest to just unconditionally convert the input file paths to absolute paths, then check the absolute path. The reason is that we can't even pass relative paths to the capnp command, anyway: capnp interprets relative path inputs relative to its working directory, which defaults to the build dir. For consistency with other CMake commands (add_library, add_executable, etc.), it makes most sense if relative file path inputs to capnp_generate_cpp() are interpreted relative to the current source directory. This means that relative path inputs need to be converted to absolute paths before being fed to capnp, which was done right after the faulty existence check.
      
      This commit fixes the issue by modifying the existence check to check the path only after it's been converted to absolute form.
      
      Closes #586.
      ae8859ce
  6. 15 Nov, 2017 1 commit
  7. 14 Nov, 2017 2 commits
  8. 10 Nov, 2017 1 commit
  9. 07 Nov, 2017 10 commits
  10. 06 Nov, 2017 3 commits
  11. 27 Oct, 2017 1 commit
  12. 25 Oct, 2017 2 commits
  13. 24 Oct, 2017 1 commit
  14. 23 Oct, 2017 3 commits
  15. 16 Oct, 2017 5 commits
  16. 14 Oct, 2017 2 commits
    • Ed Catmur's avatar
      Don't write plainchar on entry in step a · c10572fe
      Ed Catmur authored
      for the same reason - if we're called on an empty input, the output might not be a writeable pointer.
      Results in memory corruption and crash in delete on MSVC.
      c10572fe
    • Edward Catmur's avatar
      Don't read past the end of the decode out buffer. · c2fbfc70
      Edward Catmur authored
      If we finish decoding in step_a state, there is no current output character, so reading *plainchar will either be an uninitialized read or (if the output buffer is minimally sized) a past-the-end read.
      
      Detected by -fsanitize=address.
      c2fbfc70