On Sat, Oct 10, 2015 at 08:03:28PM -0700, Philip Guenther wrote:
> On Sat, 10 Oct 2015, Michael McConville wrote:
> > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged
> > up in src/usr.sbin (diff not yet carefully audited, but apparently
> > sane).
>
> These look good to me. bluhm?
Commited, thanks.
> > --- syslogd/syslogd.c
> > +++ /tmp/cocci-output-17550-6b6404-syslogd.c
> > @@ -1126,7 +1126,7 @@ octet_counting(struct evbuffer *evbuf, c
> > * It can be assumed that octet-counting framing is used if a syslog
> > * frame starts with a digit.
> > */
> > - if (buf >= end || !isdigit(*buf))
> > + if (buf >= end || !isdigit((unsigned char)*buf))
> > return (-1);
> > /*
> > * SYSLOG-FRAME = MSG-LEN SP SYSLOG-MSG
> > @@ -1134,7 +1134,7 @@ octet_counting(struct evbuffer *evbuf, c
> > * We support up to 5 digits in MSG-LEN, so the maximum is 99999.
> > */
> > for (p = buf; p < end && p < buf + 5; p++) {
> > - if (!isdigit(*p))
> > + if (!isdigit((unsigned char)*p))
> > break;
> > }
> > if (buf >= p || p >= end || *p != ' ')