bug fix, iplot(): Buffer overflow
Thanks to Zsolt Makaró for the bug report in Buffer overflow detected - ID: 3510521 http://sourceforge.net/tracker/?func=detail&aid=3510521&group_id=38962&atid=423915
This commit is contained in:
parent
0a2e031cb1
commit
b4516b08ca
|
|
@ -654,6 +654,11 @@ iplot(struct plot *pl, int id)
|
||||||
if (!yl)
|
if (!yl)
|
||||||
yl = v->v_name;
|
yl = v->v_name;
|
||||||
}
|
}
|
||||||
|
/* generate a small difference between ymin and ymax
|
||||||
|
to catch the y=const case */
|
||||||
|
if (ylims[0] == ylims[1])
|
||||||
|
ylims[1] += 1e-9;
|
||||||
|
|
||||||
if (ft_grdb)
|
if (ft_grdb)
|
||||||
fprintf(cp_err,
|
fprintf(cp_err,
|
||||||
"iplot: after 5, xlims = %G, %G, ylims = %G, %G\n",
|
"iplot: after 5, xlims = %G, %G, ylims = %G, %G\n",
|
||||||
|
|
@ -762,6 +767,8 @@ iplot(struct plot *pl, int id)
|
||||||
currentgraph->data.ymin) * YFACTOR;
|
currentgraph->data.ymin) * YFACTOR;
|
||||||
/* currentgraph->data.ymin +=
|
/* currentgraph->data.ymin +=
|
||||||
(dy - currentgraph->data.ymin) * YFACTOR;*/
|
(dy - currentgraph->data.ymin) * YFACTOR;*/
|
||||||
|
/* currentgraph->data.ymin = dy;
|
||||||
|
currentgraph->data.ymin *= (1 + YFACTOR); */
|
||||||
}
|
}
|
||||||
if (currentgraph->data.ymax <
|
if (currentgraph->data.ymax <
|
||||||
currentgraph->data.ymin)
|
currentgraph->data.ymin)
|
||||||
|
|
@ -782,6 +789,8 @@ iplot(struct plot *pl, int id)
|
||||||
currentgraph->data.ymin) * YFACTOR;
|
currentgraph->data.ymin) * YFACTOR;
|
||||||
/* currentgraph->data.ymax +=
|
/* currentgraph->data.ymax +=
|
||||||
(dy - currentgraph->data.ymax) * YFACTOR;*/
|
(dy - currentgraph->data.ymax) * YFACTOR;*/
|
||||||
|
/* currentgraph->data.ymax = dy;
|
||||||
|
currentgraph->data.ymax *= (1 + YFACTOR); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue