[Ocfs2-tools-devel] [PATCH 0/4] ocfs2-tools: avoid evaluating a garbage value

chuanchang.jia at gmail.com chuanchang.jia at gmail.com
Sat Sep 17 20:47:19 PDT 2011


ocfs2-tools: avoid evaluating a garbage value.

* fsck.ocfs2/journal.c: Variable 'jis' declared without an initial value then
  branch condition evaluates to a garbage value in 'out' section when the 
  first 'if (ret)' is ture.
* fsck.ocfs2/pass1b.c: Variable 'ret' declared without an initial value then 
  branch condition evaluates to a garbage value in 'out' section when 
  'if (pc->ret)' is ture.
* libocfs2/slot_map.c: when the first 'if (ret)' is ture, the codes will jump
  into 'out' section, however, the statement 'ocfs2_read_cached_inode(fs, blkno, &sf.ci)' 
  hasn't been executed, so 'sf.ci' is a garbage value.
* mounted.ocfs2/mounted.c: Variable 'proc' declared without an initial value,
  when 'if (device)' and the first 'if (ret)' are ture, the codes will jump
  into 'bail' section, however, the statement 'proc = fopen ("/proc/partitions", "r")'
  hasn't been executed, so 'proc' is a arbage value.

Signed-off-by: Alex Jia <chuanchang.jia at gmail.com>
---
 fsck.ocfs2/journal.c    |    2 +-
 fsck.ocfs2/pass1b.c     |    2 +-
 libocfs2/slot_map.c     |    2 +-
 mounted.ocfs2/mounted.c |    7 ++++++-
 4 files changed, 9 insertions(+), 4 deletions(-)



More information about the Ocfs2-tools-devel mailing list