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

[linux-lvm] uninitialized pointer deref upon failed mirror addition



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.


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