]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/internal.cc: check earlier for null pointer
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 4 Jun 2014 21:22:18 +0000 (23:22 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 4 Jun 2014 21:22:18 +0000 (23:22 +0200)
commit3ee3e66a9520a5fcafa7d8c632586642f7bdbd29
tree5ff7fec295f8a90df9bbe4cda19a9228afbf5cc9
parentf17a9633fc044b8b073f15ac2762b6c32a32d77e
librbd/internal.cc: check earlier for null pointer

Fix potential null ponter deref, move check for 'order != NULL'
to the beginning of the function to prevent a) deref in ldout() call
and b) to leave function as early as possible if check fails.

[src/librbd/internal.cc:843] -> [src/librbd/internal.cc:865]: (warning)
 Possible null pointer dereference: order - otherwise it is redundant
 to check it against null.

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