From 697eec2f1a47fb18cd9c7055f56133f5dedae66f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 28 Jul 2006 20:58:45 +0000 Subject: [PATCH] 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 --- bacula/src/lib/crypto.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.5