* 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:
parent
4685200fa9
commit
e25f8e1f37
2 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-11-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2013-11-02 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-mount.c: Handle symlinks to directories.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue