aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzer
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-23 13:04:31 -0400
committerJack Lloyd <[email protected]>2018-09-23 13:04:31 -0400
commit681703167cb3b49464aabbb3c335cee29338f202 (patch)
treeb2feef828ece9c6a961a433b49f4bd7bef614d4a /src/fuzzer
parentb859e175a0f2357dcfe2211ca487a7bde0e971b1 (diff)
Avoid some gcc warnings in mode padding fuzzer [ci skip]
Diffstat (limited to 'src/fuzzer')
-rw-r--r--src/fuzzer/mode_padding.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fuzzer/mode_padding.cpp b/src/fuzzer/mode_padding.cpp
index 985ea25e3..0819afb72 100644
--- a/src/fuzzer/mode_padding.cpp
+++ b/src/fuzzer/mode_padding.cpp
@@ -8,6 +8,8 @@
#include <botan/mode_pad.h>
#include <botan/internal/tls_cbc.h>
+namespace {
+
size_t ref_pkcs7_unpad(const uint8_t in[], size_t len)
{
if(len <= 2)
@@ -58,7 +60,7 @@ size_t ref_oneandzero_unpad(const uint8_t in[], size_t len)
size_t idx = len - 1;
- while(idx >= 0)
+ for(;;)
{
if(in[idx] == 0)
{
@@ -124,6 +126,8 @@ uint16_t ref_tls_cbc_unpad(const uint8_t in[], size_t len)
return padding_length + 1;
}
+}
+
void fuzz(const uint8_t in[], size_t len)
{
Botan::PKCS7_Padding pkcs7;