mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #72 from ejohnstown/static-fixes
fix a handful of clang static analysis warningspull/74/head
commit
0fc6f343b0
|
@ -564,8 +564,6 @@ THREAD_RETURN WOLFSSH_THREAD server_test(void* args)
|
|||
byte buf[SCRATCH_BUFFER_SZ];
|
||||
word32 bufSz;
|
||||
|
||||
bufName = useEcc ? "./keys/server-key-ecc.der" :
|
||||
"./keys/server-key-rsa.der" ;
|
||||
bufSz = load_key(useEcc, buf, SCRATCH_BUFFER_SZ);
|
||||
if (bufSz == 0) {
|
||||
fprintf(stderr, "Couldn't load key.\n");
|
||||
|
|
|
@ -1038,9 +1038,11 @@ int ChannelRemove(WOLFSSH* ssh, word32 channel, byte peer)
|
|||
if (ssh == NULL)
|
||||
ret = WS_BAD_ARGUMENT;
|
||||
|
||||
if (ret == WS_SUCCESS) {
|
||||
list = ssh->channelList;
|
||||
if (list == NULL)
|
||||
ret = WS_INVALID_CHANID;
|
||||
}
|
||||
|
||||
if (ret == WS_SUCCESS) {
|
||||
WOLFSSH_CHANNEL* prev = NULL;
|
||||
|
|
11
tests/unit.c
11
tests/unit.c
|
@ -397,7 +397,8 @@ static int test_Errors(void)
|
|||
#else
|
||||
int i, j = 0;
|
||||
/* Values that are not or no longer error codes. */
|
||||
int missing[] = { WS_SUCCESS };
|
||||
int missing[] = { 0 };
|
||||
int missingSz = (int)sizeof(missing)/sizeof(missing[0]);
|
||||
|
||||
/* Check that all errors have a string and it's the same through the two
|
||||
* APIs. Check that the values that are not errors map to the unknown
|
||||
|
@ -405,15 +406,15 @@ static int test_Errors(void)
|
|||
for (i = WS_SUCCESS; i >= WS_LAST_E; i--) {
|
||||
errStr = wolfSSH_ErrorToName(i);
|
||||
|
||||
if (i != missing[j]) {
|
||||
if (errStr == unknownStr) {
|
||||
if (j < missingSz && i == missing[j]) {
|
||||
j++;
|
||||
if (errStr != unknownStr) {
|
||||
result = -105;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
j++;
|
||||
if (errStr != unknownStr) {
|
||||
if (errStr == unknownStr) {
|
||||
result = -106;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue