diff --git a/examples/wolffwd/wolffwd.c b/examples/wolffwd/wolffwd.c index 55a5f28..18662bd 100644 --- a/examples/wolffwd/wolffwd.c +++ b/examples/wolffwd/wolffwd.c @@ -341,6 +341,8 @@ THREAD_RETURN WOLFSSH_THREAD wolffwd_worker(void* args) for (;;) { rxFds = templateFds; + errFds = templateFds; + to.tv_sec = 1; to.tv_usec = 0; ret = select(nFds, &rxFds, NULL, &errFds, &to); @@ -395,6 +397,8 @@ THREAD_RETURN WOLFSSH_THREAD wolffwd_worker(void* args) if (!appFdSet && FD_ISSET(listenFd, &rxFds)) { appFd = accept(listenFd, (struct sockaddr*)&fwdFromHostAddr, &fwdFromHostAddrSz); + if (appFd < 0) + break; FD_SET(appFd, &templateFds); nFds = appFd + 1; appFdSet = 1; diff --git a/tests/unit.c b/tests/unit.c index e43e0e6..3f29f8c 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -327,7 +327,7 @@ static int test_KDF(void) tv->h, &h, &hSz, tv->sessionId, &sId, &sIdSz, tv->expectedKey, &eKey, &eKeySz); - if (result != 0) { + if (result != 0 || eKey == NULL) { printf("KDF: Could not convert test vector %u.\n", i); return -100; }