Philippe Chauvat
Phil Stracchino
Preben Guldberg
+Riccardo Ghetta
Richard Mortimer
Robert Nelson
Rudolf Cejka
}
fflush(stdout);
- if (!(bpipe = open_bpipe(cmd, 120, "rw"))) {
+ if ((bpipe = open_bpipe(cmd, 120, "rw"))) {
+ /* If we had to use sendmail, add subject */
+ if (!d->mail_cmd) {
+ fprintf(bpipe->wfd, "Subject: %s\r\n\r\n", _("Bacula Message"));
+ }
+ } else {
berrno be;
Jmsg(jcr, M_ERROR, 0, _("open mail pipe %s failed: ERR=%s\n"),
cmd, be.bstrerror());
}
-
- /* If we had to use sendmail, add subject */
- if (!d->mail_cmd) {
- fprintf(bpipe->wfd, "Subject: %s\r\n\r\n", _("Bacula Message"));
- }
-
return bpipe;
}
P(mutex);
ap = (struct abufhead *) abqueue.qnext;
- while (ap != (struct abufhead *) &abqueue) {
+ while (ap != (struct abufhead *)&abqueue) {
bad = 0;
- if ((ap == NULL) ||
- (ap->abq.qnext->qprev != (struct b_queue *) ap)) {
- bad = 0x1;
- }
- if (ap->abq.qprev->qnext != (struct b_queue *) ap) {
- bad |= 0x2;
- }
- if (((unsigned char *) ap)[((struct abufhead *) ap)->ablen - 1] !=
- ((((long) ap) & 0xFF) ^ 0xC5)) {
- bad |= 0x4;
+ if (ap != NULL) {
+ if (ap->abq.qnext->qprev != (struct b_queue *)ap) {
+ bad = 0x1;
+ }
+ if (ap->abq.qprev->qnext != (struct b_queue *)ap) {
+ bad |= 0x2;
+ }
+ if (((unsigned char *) ap)[((struct abufhead *)ap)->ablen - 1] !=
+ ((((long) ap) & 0xFF) ^ 0xC5)) {
+ bad |= 0x4;
+ }
+ } else {
+ bad = 0x8;
}
badbuf |= bad;
if (bad) {
if (bad & 0x4) {
fprintf(stderr, _(" discovery of data overrun.\n"));
}
+ if (bad & 0x8) {
+ fprintf(stderr, _(" NULL pointer.\n"));
+ }
+ if (!ap) {
+ goto get_out;
+ }
fprintf(stderr, _(" Buffer address: %p\n"), ap);
if (ap->abfname != NULL) {
}
}
}
- ap = (struct abufhead *) ap->abq.qnext;
+ ap = (struct abufhead *)ap->abq.qnext;
}
+get_out:
V(mutex);
return badbuf ? 0 : 1;
}
BSR *found_bsr = NULL;
/* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */
- if (!root_bsr || !root_bsr->use_positioning ||
+ if (!root_bsr) {
+ Dmsg0(dbglevel, "NULL root bsr pointer passed to find_next_bsr.\n");
+ return NULL;
+ }
+ if (!root_bsr->use_positioning ||
!root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) {
Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
return NULL;
General:
+25May08
+kes Fix a few more Coverity reported problems.
24May08
kes Apply Allan Black's status dir job count patch.
ebl Add information about IMPORT/EXPORT slots in mtx-script.