> Increasing the size of attribs by 1 is a sufficient fix.
That depends on your definition of "sufficient". It might be, if your _only_ goal is preventing this particular array bounds overrun, and you don't care what happens to the report format, or the other code which thinks that it knows the size of attribs[] (like, for example, the piece which NUL-terminates the thing: "attribs[15] = 0;"). It might do less damage to enforce the current assumption that hostver < 100. For example, change: hostver = (unsigned)(G.pInfo->hostver); to: hostver = MIN( 99, (unsigned)(G.pInfo->hostver)); (in two places), which would seem to me to solve the problem without wrecking all the other code which deals with attribs[]. |