Skip to content

Commit

Permalink
fix: Unsigned index underflow in trimWhiteSpace
Browse files Browse the repository at this point in the history
Summary: We should prefer signed type for numeric values whenever possible.  Unsigned types are only for opaque bits.

Differential Revision: D66587108
  • Loading branch information
Yuhta authored and facebook-github-bot committed Nov 28, 2024
1 parent 2e5dadc commit 17de2d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/type/Conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ std::string_view trimWhiteSpace(const char* data, size_t length) {
}

// Trim whitespace from right side.
for (auto i = length - 1; i >= startIndex; i--) {
for (int i = length - 1; i >= startIndex; i--) {
size = 0;
auto isWhiteSpaceOrControlChar = false;

Expand Down

0 comments on commit 17de2d6

Please sign in to comment.