This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git


The following commit(s) were added to refs/heads/clucene by this push:
     new 6a9171e2 [fix] fix string to wstring buffer overflow (#109)
6a9171e2 is described below

commit 6a9171e24731f71c0d42fd246973f9cc3e153a1d
Author: zzzxl <33418555+zzzxl1...@users.noreply.github.com>
AuthorDate: Mon Jul 31 18:55:05 2023 +0800

    [fix] fix string to wstring buffer overflow (#109)
---
 src/shared/CLucene/config/utf8.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/CLucene/config/utf8.cpp 
b/src/shared/CLucene/config/utf8.cpp
index 3c9221cb..4f9f7546 100644
--- a/src/shared/CLucene/config/utf8.cpp
+++ b/src/shared/CLucene/config/utf8.cpp
@@ -267,7 +267,7 @@ std::wstring lucene_utf8stows(const std::string_view& s) {
     size++;
     i += n;
   }
-  ws.resize(size);
+  ws.resize(size + 1);
   lucene_utf8towcs(ws.data(), s.data(), s.length());
   return ws;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to