* 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:
Vladimir Serbinenko 2013-11-02 21:28:03 +01:00
parent 4685200fa9
commit e25f8e1f37
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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)