Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1914)

Unified Diff: core/src/fxcrt/fx_basic_bstring.cpp

Issue 837253002: Merge to XFA: Finish unit test for CFX_ByteStringC class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_string.h ('k') | core/src/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_bstring.cpp
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index c54148d799bebb9a865c7d227c8688e60d358bde..0d4f860b3290698e2dc8f5f59d604850465eb5bd 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -1082,7 +1082,7 @@ FX_DWORD CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const
if (m_Length == 0) {
return 0;
}
- if (start_pos >= m_Length) {
+ if (start_pos < 0 || start_pos >= m_Length) {
return 0;
}
FX_DWORD strid = 0;
« no previous file with comments | « core/include/fxcrt/fx_string.h ('k') | core/src/fxcrt/fx_basic_bstring_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698