Potential overflow in watch4str
Run applications under pseudo-terminal (PTY) sessions
Brought to you by:
mezantrop
In watch4str the read(ifd, buf + largv, sizeof(buf) - largv); and then buf[cc + largv] = '\0'; could potentially put "\0" out of the buf overwriting then next variable when largv=0 and exactly cc==sizeof(buf) bytes are red. At least in theory.
It does not happen on my systems because it seems that read() get chanks of not more than 4096 bytes (PIPE_BUF ?) while BUFSZ is 8192.
I'm sorry for the lifelong timeout. Will fix, probably like: cc = read(ifd, buf + largv, sizeof(buf) - largv - 1)
I'm sorry for the lifelong timeout. Will fix, probably like: cc = read(ifd, buf + largv, sizeof(buf) - largv - 1)
Will fix with the solution by Sergey Mironov in the bug report #6