summaryrefslogtreecommitdiffhomepage
path: root/svr-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-05-13 22:50:54 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-05-13 22:50:54 +0800
commitfb719e3d0ba3571d3abc5638d1fbbe9e1675d6a7 (patch)
tree7a72eeedf1e3c89258e1e35057f737f1d0176f9c /svr-session.c
parent9f24cdf74c93aa75416687972e69b5b4c8be2698 (diff)
fuzz harness
--HG-- branch : fuzz
Diffstat (limited to 'svr-session.c')
-rw-r--r--svr-session.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/svr-session.c b/svr-session.c
index 0e6a9e8..41571bb 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -40,6 +40,7 @@
#include "auth.h"
#include "runopts.h"
#include "crypto_desc.h"
+#include "fuzz.h"
static void svr_remoteclosed(void);
@@ -182,6 +183,13 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
session_cleanup();
}
+#ifdef DROPBEAR_FUZZ
+ // longjmp before cleaning up svr_opts
+ if (fuzz.fuzzing) {
+ longjmp(fuzz.jmp, 1);
+ }
+#endif
+
if (svr_opts.hostkey) {
sign_key_free(svr_opts.hostkey);
svr_opts.hostkey = NULL;
@@ -191,11 +199,6 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
m_free(svr_opts.ports[i]);
}
-#ifdef DROPBEAR_FUZZ
- if (opts.fuzz.fuzzing) {
- longjmp(opts.fuzz.jmp, 1);
- }
-#endif
exit(exitcode);