From a1eb92966e6769f96fe2d9d78da96f59cc299a01 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 19 Apr 2016 19:46:41 +0200 Subject: [PATCH] Fix #4663 - segfault in r2 -d --- binr/radare2/radare2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binr/radare2/radare2.c b/binr/radare2/radare2.c index 15697b3610..e01c0b36f3 100644 --- a/binr/radare2/radare2.c +++ b/binr/radare2/radare2.c @@ -444,6 +444,10 @@ int main(int argc, char **argv, char **envp) { return main_help (help > 1? 2: 0); } if (debug == 1) { + if (optind >= argc) { + eprintf ("Missing argument for -d\n"); + return 1; + } char *uri = strdup (argv[optind]); char *p = strstr (uri, "://"); if (p) {