Skip to content

Commit e647189

Browse files
authored
Merge pull request #6065 from nickanderson/CFE-4647/3.27.x
CFE-4647: Fixed segfault when cf-secret print-headers is called without an encrypted file (3.27)
2 parents 281a958 + 5a7e3f3 commit e647189

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)