fix a possible integer overflow; http://www.vuxml.org/openbsd/23ac1dfa-9273-11d9-ac88-080020fe8945.html