Skip to content

fix: reject malformed commit property integers - #843

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/reject-partial-commit-property-integers
Open

fix: reject malformed commit property integers#843
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/reject-partial-commit-property-integers

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require commit property integers to parse completely, matching Java's Integer.parseInt
  • reject values with alphanumeric or decimal suffixes instead of accepting their numeric prefix
  • preserve the existing validation errors for invalid and out-of-range values

Testing

  • ctest --test-dir build -R ^table_test$ --output-on-failure
  • full CTest suite (17 test binaries)

@fallintoplace
fallintoplace force-pushed the fix/reject-partial-commit-property-integers branch from f881c81 to d30768c Compare July 25, 2026 15:28
@fallintoplace fallintoplace changed the title fix: reject partial commit property integers fix: reject trailing characters in commit properties Jul 25, 2026
@fallintoplace fallintoplace changed the title fix: reject trailing characters in commit properties fix: reject malformed commit property integers Jul 25, 2026
Comment thread src/iceberg/util/property_util.cc Outdated
int32_t parsed;
auto [ptr, ec] = std::from_chars(it->second.data(),
it->second.data() + it->second.size(), parsed);
const auto* end = it->second.data() + it->second.size();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to replace it with StringUtils::ParseNumber<int32_t>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants