From 97dd45b3039ad9b078b771fffa510cd2e51a3ad7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 17 May 2008 23:26:57 +0000 Subject: [PATCH] Fix buffer overruns detected by Coverity git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6982 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 2 ++ bacula/src/dird/migrate.c | 12 +++++++----- bacula/src/dird/ua_restore.c | 9 ++++++--- bacula/technotes-2.3 | 2 ++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 58cbda77c7..997371491a 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -114,6 +114,8 @@ Professional Needs: Priority: ================ +- Change calling sequence to delete_job_id_range() in ua_cmds.c + the preceding strtok() is done inside the subroutine only once. - Dangling softlinks are not restored properly. For example, take a soft link such as src/testprogs/install-sh, which points to /usr/share/autoconf... move the directory to another machine where the file /usr/share/autoconf does diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 27b201af51..42fd5cf106 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -28,7 +28,7 @@ /* * * Bacula Director -- migrate.c -- responsible for doing - * migration jobs. + * migration and copy jobs. * * Also handles Copy jobs (March MMVIII) * @@ -411,13 +411,14 @@ struct idpkt { /* Add an item to the list if it is unique */ static void add_unique_id(idpkt *ids, char *item) { - char id[30]; + const int maxlen = 30; + char id[maxlen+1]; char *q = ids->list; /* Walk through current list to see if each item is the same as item */ for ( ; *q; ) { id[0] = 0; - for (int i=0; i<(int)sizeof(id); i++) { + for (int i=0; iname()); + if (rx.store) { + Dmsg1(200, "Set store=%s\n", rx.store->name()); + } } diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 0f788b2af7..6cca42aa12 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -24,6 +24,8 @@ Add long term statistics job table General: +17May08 +kes Fix buffer overruns detected by Coverity. 13May08 kes Tweak joblog display. 12May08 -- 2.39.5