On 10/28/13, 10:51 PM, Yong Zhang wrote:
> When read() returns with ERROR, local_bufused will be set
> to -1; and if we return with local_bufused == -1 left,
> the next time we call getc_with_restart(), the condition
> (local_index == local_bufused || local_bufused == 0)
> will not match, thus we get random data from localbuf[]
> with local_index increased each time, eventually we may
> access data beyond array localbuf[]. Fix it by resetting
> local_index and local_bufused in case of read failure.

Thanks for the report.  This will cause a problem only in a small set of
circumstances: a read error in an interactive shell not using readline but
with ignoreeof set.  It will be fixed in the next bash release.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to