From: Eric Bollengier Date: Tue, 28 Aug 2012 09:39:12 +0000 (+0200) Subject: Avoid problem when stripping a relative path X-Git-Tag: Release-5.2.13~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cfbd7d7a6e5310cc102a71098c42f9c19ef6b5a4;p=bacula%2Fbacula Avoid problem when stripping a relative path --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 44d7e29d5c..3a42799eb9 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -1440,8 +1440,10 @@ static bool do_strip(int count, char *in) while (*in && !IsPathSeparator(*in)) { out++; in++; } - out++; in++; - numsep++; /* one separator seen */ + if (*in) { /* Not at the end of the string */ + out++; in++; + numsep++; /* one separator seen */ + } for (stripped=0; stripped