'dialog' core dump fix [patch for approvement]

Andrey Chernov ache at nagual.pp.ru
Sun Aug 19 20:10:50 PDT 2007


On Mon, Aug 20, 2007 at 09:40:08AM +0800, Rong-en Fan wrote:
> On 8/20/07, Andrey Chernov <ache at nagual.pp.ru> wrote:
> > It fix dialog core dump with recent ghostscript-gpl port (too many items).
> > Please approve.
> 
> Could you tell more about this core dump? I haven't experienced this
> when upgrading gs-gpl on all my boxes, including i386 and amd64 6.x
> system.

    unsigned char result[MAX_LEN];
...
    retval = dialog_checklist(title, argv[offset+2], atoi(argv[offset+3]),
                              atoi(argv[offset+4]), atoi(argv[offset+5]),
                              (argc-offset-6)/3, argv+offset + 6, result);

"result" is overflowing (check the sum of tempfile strings lengths in 
the scripts/configure)
But core dump happens not here immediately, it happens in the strange 
place - in the return from main() :-) (because the stack is corrupted)

...
    EndDialog(clear_screen);
    return retval;
^ here

-- 
http://ache.pp.ru/


More information about the freebsd-ports mailing list