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

This commit is contained in:
Holger Vogt 2019-05-29 23:02:18 +02:00
parent 3d77a32be1
commit 84530eee37
1 changed files with 9 additions and 5 deletions

View File

@ -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; else {
if ((d->v_flags & VF_PERMANENT) && (plot_cur->pl_scale == NULL)) plot_cur->pl_lookup_valid = FALSE;
plot_cur->pl_scale = d; if ((d->v_flags & VF_PERMANENT) && (plot_cur->pl_scale == NULL)) {
if (!d->v_plot) plot_cur->pl_scale = d;
d->v_plot = plot_cur; }
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) {