Print an error instead of segfaulting with a bad compiler command line.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666370 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index 9f9c260..f2f3a9b 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -1112,6 +1112,10 @@
// Real-pathify it
char rp[PATH_MAX];
+ if (argv[i] == NULL) {
+ fprintf(stderr, "!!! Missing file name\n");
+ usage();
+ }
if (saferealpath(argv[i], rp) == NULL) {
failure("Could not open input file with realpath: %s", argv[i]);
}