Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dereferencing zeroth element of empty vector #97

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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