]> git.sur5r.net Git - bacula/bacula/commitdiff
o fix : restore a crypted stream on a fd witch doen't define keys cause
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 28 Jul 2006 20:58:45 +0000 (20:58 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 28 Jul 2006 20:58:45 +0000 (20:58 +0000)
         segfault.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3195 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/crypto.c

index 9b943d2bf78d68649283e2828f021dc4c20f172d..af206985dc53493558904b4c873cc89ae105fda8 100644 (file)
@@ -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;