Browse Source

[PATCH #55-2] Prevent reading from a NULL pointer

pre-master-46
Holger Vogt 7 years ago
parent
commit
f9a4800d86
  1. 14
      src/frontend/vectors.c

14
src/frontend/vectors.c

@ -764,11 +764,15 @@ vec_new(struct dvec *d)
if (plot_cur == NULL) { if (plot_cur == NULL) {
fprintf(cp_err, "vec_new: Internal Error: no cur plot\n"); fprintf(cp_err, "vec_new: Internal Error: no cur plot\n");
} }
plot_cur->pl_lookup_valid = FALSE;
if ((d->v_flags & VF_PERMANENT) && (plot_cur->pl_scale == NULL))
plot_cur->pl_scale = d;
if (!d->v_plot)
d->v_plot = plot_cur;
else {
plot_cur->pl_lookup_valid = FALSE;
if ((d->v_flags & VF_PERMANENT) && (plot_cur->pl_scale == NULL)) {
plot_cur->pl_scale = d;
}
if (!d->v_plot) {
d->v_plot = plot_cur;
}
}
/* This code appears to be a patch for incorrectly specified vectors */ /* This code appears to be a patch for incorrectly specified vectors */
if (d->v_numdims < 1) { if (d->v_numdims < 1) {

Loading…
Cancel
Save