Browse Source

FIX: off-by-one error when identifying patch/Rack version by reading the magic sequence of a zstd-compressed patch (#871)

* FIX: off-by-one error when identifying the patch/Rack version by reading the magic sequence of a zstd-compressed patch.

* review: using array of uint8_t instead of char[] for recognizing magic number of an zstd archive

* review: explicit size of the zstd magic number array
tags/26.02
fixxxedpoint GitHub 2 weeks ago
parent
commit
ab3e198db9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/CardinalPlugin.cpp

+ 1
- 1
src/CardinalPlugin.cpp View File

@@ -1104,7 +1104,7 @@ protected:
rack::system::removeRecursively(fAutosavePath);
rack::system::createDirectories(fAutosavePath);
static constexpr const char zstdMagic[] = "\x28\xb5\x2f\xfd";
static constexpr const uint8_t zstdMagic[4] = { 0x28, 0xb5, 0x2f, 0xfd };
if (std::memcmp(data.data(), zstdMagic, sizeof(zstdMagic)) != 0)
{


Loading…
Cancel
Save