Date: Tue, 24 Jun 2008 19:29:29 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 144040 for review Message-ID: <200806241929.m5OJTTSA024676@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144040 Change 144040 by gabor@gabor_server on 2008/06/24 19:28:52 - Don't forget to check if mbstowcs() succeeds Reported by: tkientzle Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/binary.c#11 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/binary.c#11 (text+ko) ==== @@ -79,7 +79,8 @@ wbuf = grep_malloc((s + 1) * sizeof(wchar_t)); - mbstowcs(wbuf, f->base, s); + if (mbstowcs(wbuf, f->base, s) == -1) + return (0); /* XXX knows too much about mmf internals */ for (i = 0; i < BUFSIZ && i < f->len; i++)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806241929.m5OJTTSA024676>