diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-09-06 20:48:02 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-09-06 20:48:02 +0200 |
commit | 6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d (patch) | |
tree | c4a052611755a37b92eced8ce15f157c996209db | |
parent | 12058892aa7a70227a9fefde0eebfaba92943912 (diff) | |
download | redo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.tar.gz redo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.tar.xz redo-c-6c0164b8bf092bc0f48a3c07b6ea6fed1e3ceb1d.zip |
Don't read after end of dirprefix
-rw-r--r-- | redo.c | 3 |
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); |