]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
auth: fix a crash issue due to CryptoHandler::create() failed
authorDunrong Huang <riegamaths@gmail.com>
Wed, 25 Nov 2015 11:03:03 +0000 (19:03 +0800)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 4 Mar 2016 02:02:37 +0000 (12:02 +1000)
commita371c0f1d69fea131b56100492d3045c15ae072c
tree0275609ebb3b1d32cc24af2ea21b9accc0b0d18a
parentaf5da4f24d7c2ea5a1322450180099278dd0da7c
auth: fix a crash issue due to CryptoHandler::create() failed

In this case(e.g. user passes wrong key), attempts to call the CryptoKey.ckh will lead to a segfault.

This patch fixes crash issue like following:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed10e700 (LWP 25051)]
0x00007ffff59896c6 in CryptoKey::encrypt (this=0x7fffed10d4f0, cct=0x555555829c30, in=..., out=..., error=0x7fffed10d440) at auth/cephx/../Crypto.h:110
110     return ckh->encrypt(in, out, error);
(gdb) bt
    at auth/cephx/../Crypto.h:110
    at auth/cephx/CephxProtocol.h:464

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
(cherry picked from commit a7f520caabf997b3753f1200f19f21830531b3f5)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/auth/Crypto.cc