Fix CWE 119 and CWE 259

Credit Steve Christey (MITRE)