Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two issues found with -fsanitize=undefined



On Mon, 21 Sep 2015 22:04:13 +0200
Markus Trippelsdorf <markus@xxxxxxxxxxxxxxx> wrote:
> Yes:
> matchbuflen: (null) with no matchbuf: 0
> It looks like the issue doesn't happen with a -DDEBUG build.
> I've changed the DPUTS line to:
>  fprintf(stderr, "matchbuflen: %s with no matchbuf: %x", matchbuf, matchbuflen);

That's fine.  If matchbuf is NULL, matchbuflen *should* be 0.

I presume you're missing that

  DPUTS(matchbuflen, "matchbuflen with no matchbuf");

is (roughly) equivalent to

  if (matchbuflen)
     fprintf(stderr, "matchbuflen with no matcbuf");

pws




Messages sorted by: Reverse Date, Date, Thread, Author