]> git-server-git.apps.pok.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)
committerJosh Durgin <josh.durgin@inktank.com>
Sat, 9 Aug 2014 23:34:11 +0000 (16:34 -0700)
commit5f74fb294a0cd9b973aae45de17f38436bac6d61
tree1dfc42db35f5f8f7e41b1ee748577b39ca61b600
parentb2189465f36fc375b864f88a47d25c7808c08901
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>
(cherry picked from commit 3ee3e66a9520a5fcafa7d8c632586642f7bdbd29)
src/librbd/internal.cc