Skip to content

Commit

Permalink
Fix dereferencing zeroth element of empty vector
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Batko committed Apr 19, 2024
1 parent 4d87ab9 commit 521a339
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dcmtls/libsrc/tlsciphr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ void DcmTLSCiphersuiteHandler::getListOfCipherSuitesForOpenSSL(OFString& cslist,
// We sort this list with the strongest ciphersuite first. Since the global list
// of ciphersuites (globalCipherSuiteList) is already sorted by strength (weakest
// ciphersuite first), we only have to sort the ciphersuite IDs in decreasing order.
qsort(&tempList[0], tempList.size(), sizeof(size_t), cipherSuiteComparison);
qsort(tempList.data(), tempList.size(), sizeof(size_t), cipherSuiteComparison);
}

for (OFVector<size_t>::const_iterator it = tempList.begin(); it != tempList.end(); ++it)
Expand Down Expand Up @@ -609,7 +609,7 @@ void DcmTLSCiphersuiteHandler::getListOfTLS13CipherSuitesForOpenSSL(OFString& cs
// We sort this list with the strongest ciphersuite first. Since the global list
// of ciphersuites (globalCipherSuiteList) is already sorted by strength (weakest
// ciphersuite first), we only have to sort the ciphersuite IDs in decreasing order.
qsort(&tempList[0], tempList.size(), sizeof(size_t), cipherSuiteComparison);
qsort(tempList.data(), tempList.size(), sizeof(size_t), cipherSuiteComparison);
}

for (OFVector<size_t>::const_iterator it = tempList.begin(); it != tempList.end(); ++it)
Expand Down

0 comments on commit 521a339

Please sign in to comment.