Re: [dwm] input status text bug?

From: Vasil Dimov <vd_AT_FreeBSD.org>
Date: Wed, 31 Oct 2007 08:01:16 +0200

On Tue, Oct 30, 2007 at 23:04:33 -0400, Ritesh Kumar wrote:
[...]
> I went through the source code and fixed the status input handling code to
> make sure it flushes the input status text only if in encounters a '\n'.
[...]
> if(FD_ISSET(STDIN_FILENO, &rd)) {
> - switch(r = read(STDIN_FILENO, inputtext, sizeof inputtext - 1)) {
> + pos = inputtext[strlen(inputtext)-1] != '\n' ? strlen(inputtext) : 0;
> + switch(r = read(STDIN_FILENO, &(inputtext[pos]), sizeof inputtext - 1 - pos)) {
[...]

Hmmz, aren't you trying to calculate strlen() of something undefined
here?

-- 
Vasil Dimov
moc.elcaro_AT_vomid.lisav        Software Developer @ Oracle/Innobase Oy
gro.DSBeerF_AT_dv                Committer @ FreeBSD.org
gro.d5v_AT_dv                    Home @ Sofia, Bulgaria

Received on Wed Oct 31 2007 - 07:01:47 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:03:34 UTC