)]}'
{
  "commit": "2d5a8e38e7443d0aef7c5fe4a3590fbaa44e8978",
  "tree": "51292d19942bca36e341cf2075fbda7247e7f157",
  "parents": [
    "73d2688300440c8af028eec865ee0dcd85e93025"
  ],
  "author": {
    "name": "Sayed Nabhan",
    "email": "nabhan@bugqore.com",
    "time": "Fri Sep 18 17:42:46 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Fri Sep 18 17:43:26 2026 -0700"
  },
  "message": "PR #2144: validate log_uniform_int_distribution stream input and harden preconditions\n\nImported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2144\n\nlog_uniform_int_distribution\u0027s param_type constructor computes log_range_ as static_cast\u003cint\u003e(ceil((1/log(base)) * log(range))). A base of 0 or 1, or a negative base for a signed IntType, violates the base \u003e 1 precondition and makes that math non-finite: 1/log(1) divides by zero, and the final cast of inf/NaN to int is undefined behavior (UBSan: \"inf is outside the range of representable values of type \u0027int\u0027\"). It was also reachable through operator\u003e\u003e, which handed whatever it parsed straight to param_type.\n\nChanges:\n- Check the param_type preconditions with ABSL_HARDENING_ASSERT.\n- Only take the log() branch for base_ \u003e 2, so an out-of-contract base never reaches the floating-point math.\n- Have operator\u003e\u003e validate max \u003e\u003d min and base \u003e 1 and set failbit on bad input instead of constructing an invalid param_type, with a test covering that rejection.\n\nMerge b15918e1696ac26b2f283a26c03671a29f9b61a6 into 8bd6e5097d96974f5c85031759c545a8e7426b4a\n\nMerging this change closes #2144\n\nPiperOrigin-RevId: 984157679\nChange-Id: I003a3dd5536fdac5731850017095915e73ab05bb\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cbd5e0ca2ba03fc2eac2486cd5a4579307c32e65",
      "old_mode": 33188,
      "old_path": "absl/random/log_uniform_int_distribution.h",
      "new_id": "99abe05abb41feae58f320c72fab8d89209893e8",
      "new_mode": 33188,
      "new_path": "absl/random/log_uniform_int_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "591b5b37e48904169a73861d0e8260d609df2de2",
      "old_mode": 33188,
      "old_path": "absl/random/log_uniform_int_distribution_test.cc",
      "new_id": "4404111b1f4a70a2c6496b10722d69f92bccee4d",
      "new_mode": 33188,
      "new_path": "absl/random/log_uniform_int_distribution_test.cc"
    }
  ]
}
