From 0cbecc941d9b53de8235d5147ee3891d57af5f49 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 3 May 2017 12:16:45 +0200
Subject: [PATCH] Do not allow empty argument of -o option (PR driver/31468).
gcc/ChangeLog:
2017-05-03 Martin Liska <mliska@suse.cz>
PR driver/31468
* gcc.c (process_command): Do not allow empty argument of -o option.
---
gcc/gcc.c | 3 +++
1 file changed, 3 insertions(+)
@@ -4472,6 +4472,9 @@ process_command (unsigned int decoded_options_count,
output_file);
}
+ if (output_file != NULL && output_file[0] == '\0')
+ fatal_error (input_location, "output file could not be empty");
+
/* If -save-temps=obj and -o name, create the prefix to use for %b.
Otherwise just make -save-temps=obj the same as -save-temps=cwd. */
if (save_temps_flag == SAVE_TEMPS_OBJ && save_temps_prefix != NULL)
--
2.12.2