# HG changeset patch # User Mike Becker # Date 1513118207 -3600 # Node ID 76bd29a11cc9ef344daa0fac9d62fa590b2851dd # Parent 11789a88d0b072d5cc16acb1efe35cc11d2e4b15 fixes a segfault when full encryption is requested during a put without specifying the key diff -r 11789a88d0b0 -r 76bd29a11cc9 dav/main.c --- a/dav/main.c Sun Dec 17 14:35:01 2017 +0100 +++ b/dav/main.c Tue Dec 12 23:36:47 2017 +0100 @@ -942,8 +942,17 @@ return -1; } } + + // if encryption is requested, but we still don't know the key, abort + if (DAV_IS_ENCRYPTED(sn) && !(sn->key)) { + fprintf(stderr, "Encryption has been requested, " + "but no default key is configured.\n" + "You may specify a custom key with the '-k' option.\n"); + return -1; + } char *tar = cmd_getoption(a, "tar"); + int ret; if(!tar) { if(!strcmp(file, "-")) {