From: Kern Sibbald Date: Sat, 17 May 2008 23:28:41 +0000 (+0000) Subject: Fix buffer overruns detected by Coverity X-Git-Tag: Release-2.4.0~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d048c90cdc9af6d1bff3a059a27686fa8a5e922c;p=bacula%2Fbacula Fix buffer overruns detected by Coverity git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6983 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index e5fd3fdba4..9c4dc8a314 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -404,13 +404,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.1 b/bacula/technotes-2.1 index 3564063145..9ec0d00812 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,8 @@ Technical notes on version 2.2 General: +17May08 +kes Fix buffer overruns detected by Coverity. Beta Release Version 2.2.10-b3 13May08