Thanks to John Darrington for reporting this.
Found by Address Sanitizer.
ofs = skip_spaces (input, n, eof, 1);
if (ofs < 0)
return -1;
ofs = skip_spaces (input, n, eof, 1);
if (ofs < 0)
return -1;
- else if (c_isdigit (input[ofs]))
+ else if (ofs < n && c_isdigit (input[ofs]))
return segmenter_parse_number__ (s, input, n, eof, type, ofs);
return segmenter_parse_number__ (s, input, n, eof, type, ofs);
- else if (input[ofs] == '.')
+ else if (ofs < n && input[ofs] == '.')