From 52a87af143a353c0f692658605685ff0627cdce4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Jun 2021 13:34:29 +0530 Subject: [PATCH] Bounds check access to byte_offsets --- src/calibre/db/sqlite_extension.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/db/sqlite_extension.cpp b/src/calibre/db/sqlite_extension.cpp index 6b083abdd7..ef409f0db5 100644 --- a/src/calibre/db/sqlite_extension.cpp +++ b/src/calibre/db/sqlite_extension.cpp @@ -139,7 +139,7 @@ private: int send_token(const icu::UnicodeString &token, int32_t start_offset, int32_t end_offset, int flags = 0) { token_buf.clear(); token_buf.reserve(4 * token.length()); token.toUTF8String(token_buf); - return current_callback(current_callback_ctx, flags, token_buf.c_str(), (int)token_buf.size(), byte_offsets[start_offset], byte_offsets[end_offset]); + return current_callback(current_callback_ctx, flags, token_buf.c_str(), (int)token_buf.size(), byte_offsets.at(start_offset), byte_offsets.at(end_offset)); } const char* iterator_language_for_script(UScriptCode script) const {