Fix crash when using -c
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Tue, 9 Aug 2016 07:25:29 +0000 (09:25 +0200)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Tue, 9 Aug 2016 07:25:29 +0000 (09:25 +0200)
nmrp.c

diff --git a/nmrp.c b/nmrp.c
index 9b05861712c5b6abf328fc0a5b28ce427b7b5ebd..7995d427f63f18704326ccf32a5b487ba5005f68 100644 (file)
--- a/nmrp.c
+++ b/nmrp.c
@@ -425,7 +425,7 @@ int nmrp_do(struct nmrpd_args *args)
                return 1;
        }
 
-       if (strcmp(args->file_local, "-") && access(args->file_local, R_OK) == -1) {
+       if (args->file_local && strcmp(args->file_local, "-") && access(args->file_local, R_OK) == -1) {
                fprintf(stderr, "Error accessing file '%s'.\n", args->file_local);
                return 1;
        }