소스 검색

Fix possible crash in TypesafeCachedYamlDatabase (#6873)

Vincent Stumpf 3 년 전
부모
커밋
ef6a682ca8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/common/database.hpp

+ 1 - 1
src/common/database.hpp

@@ -159,7 +159,7 @@ public:
 	}
 
 	std::shared_ptr<datatype> find( keytype key ) override{
-		if( this->cache.empty() || key >= this->cache.capacity() ){
+		if( this->cache.empty() || key >= this->cache.size() ){
 			return TypesafeYamlDatabase<keytype, datatype>::find( key );
 		}else{
 			return cache[this->calculateCacheKey( key )];