fix pvs studio warnings

This commit is contained in:
toddouska 2012-12-11 11:33:49 -08:00
parent 87fbf7df80
commit 7e8438b7b4
2 changed files with 37 additions and 36 deletions

View File

@ -7257,13 +7257,13 @@ int SetCipherList(Suites* s, const char* list)
ssl->options.haveSessionId = 1;
/* DoClientHello uses same resume code */
while (ssl->options.resuming) { /* let's try */
if (ssl->options.resuming) { /* let's try */
int ret;
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
if (!session) {
CYASSL_MSG("Session lookup for resume failed");
ssl->options.resuming = 0;
break; /* session lookup failed */
}
} else {
if (MatchSuite(ssl, &clSuites) < 0) {
CYASSL_MSG("Unsupported cipher suite, OldClientHello");
return UNSUPPORTED_SUITE;
@ -7282,6 +7282,7 @@ int SetCipherList(Suites* s, const char* list)
return ret;
}
}
return MatchSuite(ssl, &clSuites);
}
@ -7429,14 +7430,13 @@ int SetCipherList(Suites* s, const char* list)
ssl->options.haveSessionId = 1;
/* ProcessOld uses same resume code */
while (ssl->options.resuming) { /* let's try */
if (ssl->options.resuming) { /* let's try */
int ret;
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
if (!session) {
ssl->options.resuming = 0;
CYASSL_MSG("Session lookup for resume failed");
break; /* session lookup failed */
}
ssl->options.resuming = 0;
} else {
if (MatchSuite(ssl, &clSuites) < 0) {
CYASSL_MSG("Unsupported cipher suite, ClientHello");
return UNSUPPORTED_SUITE;
@ -7455,6 +7455,7 @@ int SetCipherList(Suites* s, const char* list)
return ret;
}
}
return MatchSuite(ssl, &clSuites);
}

View File

@ -2275,7 +2275,7 @@ static int ProcessMessage(const byte* sslFrame, SnifferSession* session,
const byte* sslBegin = sslFrame;
const byte* tmp;
RecordLayerHeader rh;
int rhSize;
int rhSize = 0;
int ret;
int decoded = 0; /* bytes stored for user in data */
int notEnough; /* notEnough bytes yet flag */