]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/FileJournal.cc: fix potential use after close cases
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 13 Nov 2014 19:14:32 +0000 (20:14 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 13 Nov 2014 22:39:10 +0000 (23:39 +0100)
commit156d17c1bdab72dfe8ca4a14463a153e40776d93
tree1957104dd48ee14c4b041a218f4ebfae0db16ee1
parent9314fe2808e7bd496cf9b2ebc24570e3cfed92e1
os/FileJournal.cc: fix potential use after close cases

Fix checks after _open() calls to make sure to use the
filehandle only if open returns '0'.

Fix for:

CID 1128395 (#1 of 1): Use after close (USE_AFTER_FREE)
 pass_closed_arg: Passing closed handle this->fd as an argument
 to pwrite.

CID 1128396 (#1 of 2): Use after close (USE_AFTER_FREE)
 pass_closed_arg: Passing closed handle this->fd as an argument
 to read_header.

CID 1128397 (#1 of 1): Use after close (USE_AFTER_FREE)
 pass_closed_arg: Passing closed handle this->fd as an argument
 to read_header.

CID 1128398 (#1 of 1): Use after close (USE_AFTER_FREE)
 pass_closed_arg: Passing closed handle this->fd as an argument
 to read_header.

CID 1128400 (#1 of 1): Use after close (USE_AFTER_FREE)
 pass_closed_arg: Passing closed handle this->fd as an argument
 to read_header.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/os/FileJournal.cc