From 3aa456772d9569f5edc9ba5acfacc11e65908c9b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 28 Aug 2012 11:39:12 +0200 Subject: [PATCH] Avoid problem when stripping a relative path --- bacula/src/filed/backup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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