Files
systemd/test/units
Yu Watanabe a93be359ae sd-journal: fix corrupted journal handling of generic_array_bisect()
Let's consider the following case:
- the direction is down,
- no cached entry,
- the array has 5 entry objects,
- the function test_object() reutns TEST_LEFT for the 1st object,
- the 2nd, 3rd, and 4th objects are broken, so generic_array_bisect_step()
  returns TEST_RIGHT for the object.

Then, previously, generic_array_bisect_step() updated the values like the following:
  0th: (m = 5, left = 0, right = 4, i = 4) -> (m = 4, left = 0, right = 3, RIGHT)
  1st: (m = 4, left = 0, right = 3, i = 1) -> (m = 4, left = 2, right = 3, LEFT)
  2nd: (m = 4, left = 2, right = 3, i = 2) -> (m = 2, left = 2, right = 1, RIGHT) <- ouch!!
So, assert(left < right) in generic_array_bisect() was triggered.
See issue #30210.

In such situation, there is no matching entry in the array. By returning
TEST_GOTO_PREVIOUS, generic_array_bisect() handles the result so.

Fixes a bug introduced by ab8f553d1e.

Fixes #30210.
2023-12-01 09:56:10 +09:00
..
2023-07-04 21:55:53 +02:00
2023-05-24 20:06:10 +09:00
2023-08-12 10:13:56 +02:00
2023-09-27 14:50:19 +02:00
2023-05-26 00:45:54 -04:00
2023-10-31 14:35:33 +09:00
2023-08-23 15:12:23 +02:00
2022-08-23 10:53:47 +02:00
2022-08-23 10:53:47 +02:00
2023-10-04 08:58:10 +09:00
2023-09-19 21:45:27 +08:00