)]}'
{
  "commit": "7e810b803e17eb562c9c5aab72b6da6d05387990",
  "tree": "a21f41911c9f18b16955f51ba5410f2dba8d1c28",
  "parents": [
    "957149a29f4f58d6b9ff740b839ede37fd5f5657"
  ],
  "author": {
    "name": "Laramie Leavitt",
    "email": "lar@google.com",
    "time": "Sun Nov 15 23:05:42 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Nov 16 12:59:47 2026 -0800"
  },
  "message": "Validate stream deserialization UB across `absl/random`.\n\n* Initialize `dest \u003d 0` and short-circuit on `is.fail()` in\n  `random_internal::read_floating_point`, and guard `is.clear()` with\n  `!is.bad()` as defense-in-depth so `failbit` is never cleared when\n  `badbit` is set and uninitialized reads on empty or failed streams are\n  prevented.\n* Add `random_internal::read_integral(is, out)` (passing `IntType\u0026` by\n  reference) to reject leading `\u0027-\u0027` (including `\"-0\"`) for unsigned\n  types (preventing `std::num_get` modular wraparound) and validate\n  1-byte bounds before narrowing from `stream_format_type`; use it in\n  `stream_u128_helper` and across distribution and engine `operator\u003e\u003e`\n  overloads.\n* Validate deserialized parameters in `operator\u003e\u003e` for all distributions\n  (`bernoulli_distribution`, `beta_distribution`,\n  `discrete_distribution`, `exponential_distribution`,\n  `gaussian_distribution`, `log_uniform_int_distribution`,\n  `poisson_distribution`, `uniform_int_distribution`,\n  `uniform_real_distribution`, `zipf_distribution`) and engines\n  (`pcg_engine`, `randen_engine`), and add `istream_state_saver` (forcing\n  `dec | skipws`) to `pcg_engine` and `randen_engine`:\n  - Set `std::ios_base::failbit` and preserve the existing object state\n    on precondition violations, non-finite values, out-of-range narrow\n    integers, negative unsigned tokens, overflow, or truncated streams.\n  - In `discrete_distribution::operator\u003e\u003e`, use `size_t` for the loop\n    counter, reject `n \u003d\u003d 0`, out-of-range `n`, non-finite/negative\n    weights, all-zero weight vectors, and finite weight sums that\n    overflow `double`, and cap initial `reserve()` to avoid OOM on\n    adversarial inputs.\n  - In `poisson_distribution::operator\u003e\u003e`, add\n    `random_internal::kPoissonMaxMean` and reject `mean \u003c 0`,\n    non-finite values, `mean \u003e kPoissonMaxMean`, and\n    `mean \u003e std::numeric_limits\u003cresult_type\u003e::max()`.\n  - In `randen_engine::operator\u003e\u003e`, validate `next` in\n    `[kCapacityT, kStateSizeT]` so inner sponge capacity cannot be\n    exposed and `discard()` cannot underflow.\n  - In `pcg_engine::operator\u003e\u003e`, validate all extracted multiplier,\n    increment, and state tokens.\n\nPiperOrigin-RevId: 1022532452\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "42b59d3f3d31a6e6e633b6b9b65c7e54c4539653",
      "old_mode": 33188,
      "old_path": "absl/random/BUILD.bazel",
      "new_id": "162e3281bcdd57e9c4c6e113845b489ac06bb199",
      "new_mode": 33188,
      "new_path": "absl/random/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "b2c3fa2f87e0eae4e2735f1faea538d21d6b616a",
      "old_mode": 33188,
      "old_path": "absl/random/CMakeLists.txt",
      "new_id": "774825dfddb29381b010ff529e4a87a9e37a15a6",
      "new_mode": 33188,
      "new_path": "absl/random/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "10c24e62212f8033f162969a0ecc3bc205db0339",
      "old_mode": 33188,
      "old_path": "absl/random/bernoulli_distribution.h",
      "new_id": "efe1990294d90406f8375a47ddf3e98d0470bd24",
      "new_mode": 33188,
      "new_path": "absl/random/bernoulli_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "9c04bf6c6572fd3eb63e38a882afefdfc9b65b6f",
      "old_mode": 33188,
      "old_path": "absl/random/bernoulli_distribution_test.cc",
      "new_id": "640f89754193b610165d4c8c52189f8fac15581b",
      "new_mode": 33188,
      "new_path": "absl/random/bernoulli_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "a2cdd2554963c4944ebd1f00ef78327cf366977a",
      "old_mode": 33188,
      "old_path": "absl/random/beta_distribution.h",
      "new_id": "b2d0f8fa39de8635d8b2243681277e78e91a8a6b",
      "new_mode": 33188,
      "new_path": "absl/random/beta_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "7e06cb2835424187524ec55bd98e962d1d6c0433",
      "old_mode": 33188,
      "old_path": "absl/random/beta_distribution_test.cc",
      "new_id": "01b1eb576743e8d29c816d751a3f94e71d714ff5",
      "new_mode": 33188,
      "new_path": "absl/random/beta_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "35d42c80b6af37b3746cb56e73597836f704abb2",
      "old_mode": 33188,
      "old_path": "absl/random/discrete_distribution.h",
      "new_id": "de710a98b2928afac2193f7d36c9c5e033c260e0",
      "new_mode": 33188,
      "new_path": "absl/random/discrete_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "9d961f779da72a72b4bb8d7feaa2d9b9a43f9686",
      "old_mode": 33188,
      "old_path": "absl/random/discrete_distribution_test.cc",
      "new_id": "49f92744fc0e219b75d47df62548c5910e7028d9",
      "new_mode": 33188,
      "new_path": "absl/random/discrete_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "21a02793911f71e54388c6963941b74dc826a7fc",
      "old_mode": 33188,
      "old_path": "absl/random/exponential_distribution.h",
      "new_id": "507a362154eb62e50065eb6f68c5f4f5091343ca",
      "new_mode": 33188,
      "new_path": "absl/random/exponential_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "71be99ec0cb9b4a3b049750246a199b46416bdeb",
      "old_mode": 33188,
      "old_path": "absl/random/exponential_distribution_test.cc",
      "new_id": "fe3eebf154217cad8d26fc18ea838c841d91c8eb",
      "new_mode": 33188,
      "new_path": "absl/random/exponential_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "d14de0b2640a545fe3dc1dd494a1fdc9085db9b2",
      "old_mode": 33188,
      "old_path": "absl/random/gaussian_distribution.h",
      "new_id": "9511b3da5089ba681d250aa5511aba9fc4520256",
      "new_mode": 33188,
      "new_path": "absl/random/gaussian_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "65fd85a1bdd495a1577ef5ba9bee67475559a651",
      "old_mode": 33188,
      "old_path": "absl/random/gaussian_distribution_test.cc",
      "new_id": "5b243fae8e418923ffdf541c3c5a7ce7bf513275",
      "new_mode": 33188,
      "new_path": "absl/random/gaussian_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "4ae6fcbfd751afaeb140e06fdbf2b82324448d70",
      "old_mode": 33188,
      "old_path": "absl/random/internal/distribution_test_util.cc",
      "new_id": "2690b7e604f8baebbce14b580147b5c2a95b972a",
      "new_mode": 33188,
      "new_path": "absl/random/internal/distribution_test_util.cc"
    },
    {
      "type": "modify",
      "old_id": "1189340e3a78329d33b44a7bdd258be509514ae4",
      "old_mode": 33188,
      "old_path": "absl/random/internal/distribution_test_util.h",
      "new_id": "4668abd1d00a05ad591a774e6aebf8af7bf502fb",
      "new_mode": 33188,
      "new_path": "absl/random/internal/distribution_test_util.h"
    },
    {
      "type": "modify",
      "old_id": "1b66879ffcba12d1c33aad708cf6fbae49f80c0c",
      "old_mode": 33188,
      "old_path": "absl/random/internal/distribution_test_util_test.cc",
      "new_id": "440893c7f962fd5019c828e1b6b4c22de8485361",
      "new_mode": 33188,
      "new_path": "absl/random/internal/distribution_test_util_test.cc"
    },
    {
      "type": "modify",
      "old_id": "05d9f839e1a3d47b532e0c8f0cedf6a62330b692",
      "old_mode": 33188,
      "old_path": "absl/random/internal/iostream_state_saver.h",
      "new_id": "985e0f83e60dee4d6c05a9c40ebb284b4f7df595",
      "new_mode": 33188,
      "new_path": "absl/random/internal/iostream_state_saver.h"
    },
    {
      "type": "modify",
      "old_id": "a196ace76ecb5812e5e272c1fc839218a93f38c0",
      "old_mode": 33188,
      "old_path": "absl/random/internal/iostream_state_saver_test.cc",
      "new_id": "49adf691d6ce61968b8bf16b16df62b022427953",
      "new_mode": 33188,
      "new_path": "absl/random/internal/iostream_state_saver_test.cc"
    },
    {
      "type": "modify",
      "old_id": "f85a1acdd221d9c632df071c69f65c74f40119c6",
      "old_mode": 33188,
      "old_path": "absl/random/internal/pcg_engine.h",
      "new_id": "e78539279790df016f54884474dc7eb24876d623",
      "new_mode": 33188,
      "new_path": "absl/random/internal/pcg_engine.h"
    },
    {
      "type": "modify",
      "old_id": "9b34cfe7eb35113079d5d567f5095d56abd17ed5",
      "old_mode": 33188,
      "old_path": "absl/random/internal/pcg_engine_test.cc",
      "new_id": "e7e257ea6b3f4b5740a7fc1d373a32a528d0c504",
      "new_mode": 33188,
      "new_path": "absl/random/internal/pcg_engine_test.cc"
    },
    {
      "type": "modify",
      "old_id": "c2a8f54900cd73d85655d074eb6fb5a72449e5ff",
      "old_mode": 33188,
      "old_path": "absl/random/internal/randen_engine.h",
      "new_id": "6c31ce69063db6d8c0308a6283b17e6f154fa94b",
      "new_mode": 33188,
      "new_path": "absl/random/internal/randen_engine.h"
    },
    {
      "type": "modify",
      "old_id": "5488bd522b6aef88497b5f8513b45a972f3b649f",
      "old_mode": 33188,
      "old_path": "absl/random/internal/randen_engine_test.cc",
      "new_id": "4d54677046ad6756574163f5bc78cc32526325fc",
      "new_mode": 33188,
      "new_path": "absl/random/internal/randen_engine_test.cc"
    },
    {
      "type": "modify",
      "old_id": "99abe05abb41feae58f320c72fab8d89209893e8",
      "old_mode": 33188,
      "old_path": "absl/random/log_uniform_int_distribution.h",
      "new_id": "8bcb60ef45b2737d649e6810ab8207dfcd08af19",
      "new_mode": 33188,
      "new_path": "absl/random/log_uniform_int_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "4404111b1f4a70a2c6496b10722d69f92bccee4d",
      "old_mode": 33188,
      "old_path": "absl/random/log_uniform_int_distribution_test.cc",
      "new_id": "733a9ef7914682539591d9ee8627475d14ce47b3",
      "new_mode": 33188,
      "new_path": "absl/random/log_uniform_int_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "ae2e095be370ce6747ea5ede1bd41513d25392eb",
      "old_mode": 33188,
      "old_path": "absl/random/poisson_distribution.h",
      "new_id": "16ab7ab0d36f4962faf718b224085120b6253afa",
      "new_mode": 33188,
      "new_path": "absl/random/poisson_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "e8ee36436283fc9991458e9ae8e8bc43608e399d",
      "old_mode": 33188,
      "old_path": "absl/random/poisson_distribution_test.cc",
      "new_id": "7fee9333a61e08a63123aa6ff8df1302f0a6f674",
      "new_mode": 33188,
      "new_path": "absl/random/poisson_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "0dc7c62c3e330257dff266088acf267e9e9b19eb",
      "old_mode": 33188,
      "old_path": "absl/random/uniform_int_distribution.h",
      "new_id": "f5c884f2d2518ab32ac2e12d8551f544c267025c",
      "new_mode": 33188,
      "new_path": "absl/random/uniform_int_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "b055833c23e3787c9c16a70bbf6d171b897a7191",
      "old_mode": 33188,
      "old_path": "absl/random/uniform_int_distribution_test.cc",
      "new_id": "da8d0ca45bbbca173c79633e7b0276013918107b",
      "new_mode": 33188,
      "new_path": "absl/random/uniform_int_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "79cf79336e88ea90cff0eceac2858346e217cb7d",
      "old_mode": 33188,
      "old_path": "absl/random/uniform_real_distribution.h",
      "new_id": "9ffb9c31cc9b9811ec056a2dcbec1cc452bd83a5",
      "new_mode": 33188,
      "new_path": "absl/random/uniform_real_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "11e1d6581bddf00f942383d098dc76076657995b",
      "old_mode": 33188,
      "old_path": "absl/random/uniform_real_distribution_test.cc",
      "new_id": "0bae95e182cd0eb69527b519aa02e43493f15b02",
      "new_mode": 33188,
      "new_path": "absl/random/uniform_real_distribution_test.cc"
    },
    {
      "type": "modify",
      "old_id": "21e3b709b05cabd1852932e90a15c063ec9a25df",
      "old_mode": 33188,
      "old_path": "absl/random/zipf_distribution.h",
      "new_id": "50d94108e3827edac5b8af332f5a5ca94d2ada50",
      "new_mode": 33188,
      "new_path": "absl/random/zipf_distribution.h"
    },
    {
      "type": "modify",
      "old_id": "f29aca5935a6a254132b890b6ebb84effbb88617",
      "old_mode": 33188,
      "old_path": "absl/random/zipf_distribution_test.cc",
      "new_id": "2b2a63639f4e419713da8712f27280ee10723520",
      "new_mode": 33188,
      "new_path": "absl/random/zipf_distribution_test.cc"
    }
  ]
}
