We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e21bc0 commit 071df33Copy full SHA for 071df33
tests/fuzz/BaseDecodeFuzz.cpp
@@ -1,9 +1,15 @@
1
#include <jwt-cpp/base.h>
2
+#include <openssl/evp.h>
3
4
extern "C" {
5
6
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
- jwt::base::decode<jwt::alphabet::base64>(std::string{(char *)Data, Size});
7
+ std::vector<uint8_t> encoded(4*((Size+2)/3, 0);
8
+ if(EVP_EncodeBlock(encoded.data(), Data, Size) != encoded.size())
9
+ abort(); // Critical error using OpenSSL
10
+
11
+ jwt::base::decode<jwt::alphabet::base64>(std::string{encoded.begin(), encoded.end()}); // TO DO: Compare against input
12
return 0; // Non-zero return values are reserved for future use.
13
}
-}
14
15
+}
0 commit comments