Carefully handle '\0' in strchr arguments.
Carefully handle '\0' in strchr arguments.

The environment variable LESSBINFMT is not properly validated. If it is
set to "*", less will perform an out of boundary access.

This happens because strchr can be called with '\0' as second argument.
Such a call won't return NULL but the address of the '\0' in the string.
Therefore, the checkfmt function won't notice that the environment
variable is invalid.
--
The file line.c has the same issue but I'm not sure if '\0' is a valid
code in an ANSI sequence or not.

gdamore/less-fork,gdamore/less-fork