[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) {
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 */
if (d->v_numdims < 1) {