about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-06 20:48:02 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-06 20:48:02 +0200
commit6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d (patch)
treec4a052611755a37b92eced8ce15f157c996209db
parent12058892aa7a70227a9fefde0eebfaba92943912 (diff)
downloadredo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.tar.gz
redo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.tar.xz
redo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.zip
Don't read after end of dirprefix
-rw-r--r--redo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/redo.c b/redo.c
index f9fa518..8edf657 100644
--- a/redo.c
+++ b/redo.c
@@ -589,7 +589,8 @@ run_script(char *target, int implicit)
 		while (*--dirprefix != '/')
 			;
 	}
-	dirprefix++;
+	if (*dirprefix)
+		dirprefix++;
 
 	snprintf(temp_target, sizeof temp_target,
 	    "%s%s%s", dirprefix, "/"+(*dirprefix ? 0 : 1), temp_target_base);