mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 15:22:39 +00:00
* grub-core/lib/reed_solomon.c (grub_reed_solomon_recover): Don't do
Reed-Solomon recovery if more than half of redundancy info is 0.
This commit is contained in:
1 parent
4685200fa9
commit
e25f8e1f37
2 files changed
+12
No files matched your search
@@ -382,11 +382,18 @@ grub_reed_solomon_recover (void *ptr_, grub_size_t s, grub_size_t rs)
|
||||
{
|
||||
gf_single_t *ptr = ptr_;
|
||||
gf_single_t *rptr = ptr + s;
|
||||
grub_uint8_t *cptr;
|
||||
|
||||
/* Nothing to do. */
|
||||
if (!rs)
|
||||
return;
|
||||
|
||||
for (cptr = rptr + rs - 1; cptr >= rptr; cptr--)
|
||||
if (*cptr)
|
||||
break;
|
||||
if (rptr + rs - 1 - cptr > (grub_ssize_t) rs / 2)
|
||||
return;
|
||||
|
||||
init_powx ();
|
||||
|
||||
while (s > 0)
|
||||
|
||||
Reference in new issue
Block a user