uninitialized pointer deref upon failed mirror addition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While preparing an unrelated patch, I saw this warning go by,
so went and looked:

  metadata/mirror.c: In function 'add_mirror_images':
  metadata/mirror.c:1347: warning: 'log_lv' may be used uninitialized in this function

It turns out that it is a legitimate warning, indeed,
and an uninitialized log_lv will be dereferenced if any
of the "goto out_remove_log;" statements is reached with
log_count == 0 (aka log_lv uninitialized).

If someone can tell me precisely how to exercise one of the offending
code paths, I'll try to make time to write a test script that'd be run
via "make check".

Here's a proposed (but untested) fix.

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux