[Graph Libraries] Off-by-one bug in 2.38.0
Ported Issue from Mantis Original ID: 2458 Reported By: phisama
SEVERITY: MAJOR Submitted: 2014-05-22 22:49:49
OS: OPENSUSE
OS BUILD: 13.1
PLATFORM: LINUX
DESCRIPTION
While trying to build packages for 2.38.0 I get a warning about array overflow in lib/common/htmltable.c(doBorder):
case BORDER_TOP|BORDER_LEFT|BORDER_BOTTOM :
AF[5] = AF[1];
AF[6] = AF[2];
As AF is defined to hold 6 values this is a clear off-by-one error. What is the right fix for this code?
BTW, this is only a warning but for our builds this warning will make the build fail.
STEPS TO REPRODUCE
Just compile with -Wall.