mirror of https://github.com/milvus-io/milvus.git
Check length before comparing strings (#28112)
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>pull/28177/head
parent
5fae32f77e
commit
355fcc350d
|
@ -77,6 +77,9 @@ GetDatasetLims(const DatasetPtr& dataset) {
|
|||
|
||||
inline bool
|
||||
PrefixMatch(const std::string_view str, const std::string_view prefix) {
|
||||
if (prefix.length() > str.length()) {
|
||||
return false;
|
||||
}
|
||||
auto ret = strncmp(str.data(), prefix.data(), prefix.length());
|
||||
if (ret != 0) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue