On Thu, Dec 18, 2008 at 11:28:12AM +0100, Dr. Werner Fink wrote:
> 
> I'm able to reproduce and I've detected the problem in
> src/cmd/ksh93/sh/lex.c in line 1568 which is in the
> function nested_here() ... it seems that the value
> of lp->lexd.docend becomes negative (with your example
> -10962) which cause a negative n (I see -8186) which
> cause the following newof() in line 1567 to return NULL,
> therefore the next line
> 
>      iop->iolst = lp->heredoc;
> 
> will crash.

Could it be that the fcin API does not check if the buffer
boundary of the underlying stream is crossed due a refill?
AFAICS from e.g. the fcseek() macro is simply does increase
the pointers position. This could also explain whe not only
the `m' script crashes but also `ksh nested_script' ...
I guess that the buffers stream is refilled after SF_BUFSIZE
but the coordinates hold in e.g. lp->lexd.docend are not
updated.  But this only a guess ...

     Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to