bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Failure of resizeterm() causes subsequent call with stdscr to crash


From: Peter Bierma
Subject: Failure of resizeterm() causes subsequent call with stdscr to crash
Date: Wed, 25 Sep 2024 08:29:10 -0400

Hello,

This was reported downstream as a bug in Python's curses module. See the issue there: https://github.com/python/cpython/issues/120378

It seems that calling resizeterm() with some ridiculous resolution (35000x1 in the CPython issue) causes stdscr to break (i.e., a crash). A small reproducer:

    #include <curses.h> // or ncurses.h

    int
    main(void)
    {
        initscr();
        if (resizeterm(35000, 1) < 0) {
            puts("resizeterm() failed, trying to reset");
        }
        wrefresh(stdscr); // Segfault!
        return 0;
    }

At first I thought this was an issue with stdscr getting freed, but manually resetting it with initscr() still causes use of stdscr to crash. Any ideas?

Best regards,
Peter Bierma

reply via email to

[Prev in Thread] Current Thread [Next in Thread]