Skip to content

Commit 8d6bdee

Browse files
authored
Merge pull request #6063 from nickanderson/CFE-4647/master
CFE-4647: Fixed segfault when cf-secret print-headers is called without an encrypted file
2 parents 0e5668e + deb64f0 commit 8d6bdee

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cf-secret/cf-secret.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,11 @@ int main(int argc, char *argv[])
951951

952952
if (print_headers)
953953
{
954+
if (input_path == NULL)
955+
{
956+
Log(LOG_LEVEL_ERR, "No input file specified (Use -h for help)");
957+
DoCleanupAndExit(EXIT_FAILURE);
958+
}
954959
FILE *input_file = OpenInputOutput(input_path, "r");
955960
char key[MAX_HEADER_KEY_LEN + 1];
956961
char value[MAX_HEADER_VAL_LEN + 1];

0 commit comments

Comments
 (0)