From: Kern Sibbald Date: Thu, 13 Oct 2005 18:55:49 +0000 (+0000) Subject: Fix error conditions in bpipe.c DVD routine (terminate buffer). X-Git-Tag: Release-7.0.0~8401 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=056de6a969f6f7de3af9dec6d23040cfe9bfc34d;p=bacula%2Fbacula Fix error conditions in bpipe.c DVD routine (terminate buffer). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2439 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index bee3634e18..871ce2afc8 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -5,6 +5,7 @@ General: Changes to 1.37.41: 13Oct05 +- Fix error conditions in bpipe.c DVD routine (terminate buffer). - Use a bigger buffer 32K as suggested by Arno in bpipe.c. - Increase dvd mount timeout with patch from Arno. - Modify DVD code so that it keeps a state flag that indicates diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 0e9b9d54a9..e75b7698bd 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -338,7 +338,9 @@ int run_program_full_output(char *prog, int wait, POOLMEM *results) sm_check(__FILE__, __LINE__, false); tmp[0] = 0; while (1) { + buf[0] = 0; fgets(buf, bufsize, bpipe->rfd); + buf[bufsize] = 0; pm_strcat(tmp, buf); if (feof(bpipe->rfd)) { stat1 = 0;