[openssh-commits] [openssh] 01/01: fix some bugs in the fuzzer
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon May 30 09:29:24 AEST 2022
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit dc7bc52372f2744fa39191577be5306ee57aacd4
Author: Damien Miller <djm at mindrot.org>
Date: Mon May 30 09:29:09 2022 +1000
fix some bugs in the fuzzer
---
regress/misc/fuzz-harness/authkeys_fuzz.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/regress/misc/fuzz-harness/authkeys_fuzz.cc b/regress/misc/fuzz-harness/authkeys_fuzz.cc
index 6fe001fa..8b3e54e5 100644
--- a/regress/misc/fuzz-harness/authkeys_fuzz.cc
+++ b/regress/misc/fuzz-harness/authkeys_fuzz.cc
@@ -49,9 +49,14 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
}
if (cp == NULL || pw == NULL || key == NULL || cert == NULL)
abort();
+
+ // Cleanup whitespace at input EOL.
+ for (; size > 0 && strchr(" \t\r\n", data[size - 1]) != NULL; size--) ;
+
+ // Append a pubkey that will match.
memcpy(cp, data, size);
cp[size] = ' ';
- memcpy(cp + size + 1, key, strlen(pubkey) + 1);
+ memcpy(cp + size + 1, pubkey, strlen(pubkey) + 1);
// Try key.
if ((tmp = strdup(cp)) == NULL)
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list