* conf/Makefile.common (CFLAGS_GNULIB): Add
-Wno-unsafe-loop-optimizations. * configure.ac: Remove -Wmissing-declarations and -Wmissing-prototypes on tools. * grub-core/commands/legacycfg.c: Add pragma to skip -Wunsafe-loop-optimizations. (check_password_md5_real): Fix loop counter type. * grub-core/commands/testload.c (grub_cmd_testload): Fix over the EOF reading. * grub-core/disk/ldm.c (grub_util_get_ldm): Fix logic error. * grub-core/fs/zfs/zfs_sha256.c (zio_checksum_SHA256): Add safety loop condition. * grub-core/io/gzio.c: Add pragma to skip -Wunsafe-loop-optimizations. * grub-core/lib/LzmaEnc.c (GetOptimum): Avoid possible infinite loop. * grub-core/net/net.c (grub_net_route_address): Add safety loop condition. * grub-core/normal/charset.c (bidi_line_wrap): Likewise. * grub-core/normal/cmdline.c (grub_set_history): Fix loop types and avoid possible infinite loops. * grub-core/script/parser.y: Add pragma to skip -Wmissing-declarations and -Wunsafe-loop-optimizations. * grub-core/script/yylex.l: Likewise. * util/grub-mkfont.c: Add pragma to skip -Wunsafe-loop-optimizations. (print_glyphs): Avoid infinite loops. * util/grub-mkimage.c (compress_kernel_xz): Fix format security.
This commit is contained in:
parent
697f18b067
commit
4e27343fb0
16 changed files with 74 additions and 27 deletions
|
@ -831,7 +831,7 @@ grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start)
|
|||
{
|
||||
struct grub_diskfilter_pv *pv = NULL;
|
||||
struct grub_diskfilter_vg *vg = NULL;
|
||||
struct grub_diskfilter_lv *res, *lv;
|
||||
struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0;
|
||||
|
||||
pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
|
||||
|
||||
|
@ -844,19 +844,21 @@ grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start)
|
|||
&& lv->segments->nodes->pv == pv
|
||||
&& lv->segments->nodes->start + pv->start_sector == start)
|
||||
{
|
||||
res = lv;
|
||||
res_lv = lv;
|
||||
break;
|
||||
}
|
||||
if (!res_lv)
|
||||
return NULL;
|
||||
for (lv = vg->lvs; lv; lv = lv->next)
|
||||
if (lv->segment_count == 1 && lv->segments->node_count == 1
|
||||
&& lv->segments->type == GRUB_DISKFILTER_MIRROR
|
||||
&& lv->segments->nodes->lv == lv)
|
||||
&& lv->segments->nodes->lv == res_lv)
|
||||
{
|
||||
res = lv;
|
||||
break;
|
||||
}
|
||||
if (res->fullname)
|
||||
return grub_strdup (lv->fullname);
|
||||
if (res && res->fullname)
|
||||
return grub_strdup (res->fullname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue