/* 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; i<maxlen; i++) {
if (*q == 0) {
break;
} else if (*q == ',') {
*/
static int get_next_dbid_from_list(char **p, DBId_t *DBId)
{
- char id[30];
+ const int maxlen = 30;
+ char id[maxlen+1];
char *q = *p;
id[0] = 0;
- for (int i=0; i<(int)sizeof(id); i++) {
+ for (int i=0; i<maxlen; i++) {
if (*q == 0) {
break;
} else if (*q == ',') {
*/
int get_next_jobid_from_list(char **p, JobId_t *JobId)
{
- char jobid[30];
+ const int maxlen = 30;
+ char jobid[maxlen+1];
char *q = *p;
jobid[0] = 0;
- for (int i=0; i<(int)sizeof(jobid); i++) {
+ for (int i=0; i<maxlen; i++) {
if (*q == 0) {
break;
} else if (*q == ',') {
/* Take command line arg, or ask user if none */
rx.store = get_storage_resource(ua, false /* don't use default */);
- Dmsg1(200, "Set store=%s\n", rx.store->name());
-
+ if (rx.store) {
+ Dmsg1(200, "Set store=%s\n", rx.store->name());
+ }
}
Technical notes on version 2.2
General:
+17May08
+kes Fix buffer overruns detected by Coverity.
Beta Release Version 2.2.10-b3
13May08