From: Eric Bollengier Date: Fri, 28 Jul 2006 20:58:45 +0000 (+0000) Subject: o fix : restore a crypted stream on a fd witch doen't define keys cause X-Git-Tag: Release-2.0.0~707 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a1f57f26afd5ef2c63212ecf92cc27d00f188766;p=bacula%2Fbacula o fix : restore a crypted stream on a fd witch doen't define keys cause segfault. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3195 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/crypto.c b/bacula/src/lib/crypto.c index 9b943d2bf7..af206985dc 100644 --- a/bacula/src/lib/crypto.c +++ b/bacula/src/lib/crypto.c @@ -1134,6 +1134,11 @@ crypto_error_t crypto_session_decode(const uint8_t *data, uint32_t length, alist unsigned char *p = (unsigned char *)data; #endif + /* bacula-fd.conf doesn't contains any key */ + if (!keypairs) { + return CRYPTO_ERROR_NORECIPIENT; + } + cs = (CRYPTO_SESSION *) malloc(sizeof(CRYPTO_SESSION)); if (!cs) { return CRYPTO_ERROR_INTERNAL;