GNOME Bugzilla – Bug 312260
vte segfaults if no termcap file is found
Last modified: 2005-08-12 19:51:57 UTC
1) vte_terminal_set_emulation calls vte_terminal_set_termcap(terminal, NULL, FALSE); 2) vte_terminal_set_termcap gets passed NULL as path and hence it tries to first open: wpath = g_strdup_printf(DATADIR "/" PACKAGE "/termcap/%s", terminal->pvt->emulation ? terminal->pvt->emulation : vte_terminal_get_default_emulation(terminal)); if (stat(wpath, &st) != 0) { g_free(wpath); wpath = g_strdup("/etc/termcap"); } If we don't find both files (DATADIR "/" PACKAGE "/termcap/%s" _and_ /etc/termcap) 3) _vte_termcap_new(NULL) gets called and from there on the _vte_termcap termcap variable is NULL all the time and we trigger a whole bunch of "_vte_termcap_find: assertion `termcap != NULL' failed" warnings. We also end up in a segfault as soon as we _vte_termcap_destroy gets called by the g_cache cleanup handlers since we have: for (entry = termcap->entries; entry != NULL; entry = nextentry) { at the beginning of that function. I'll attach a patch that fixes the destroy handler to not crash. We could also simply refuse to start if no termcap file.
Created attachment 50081 [details] [review] Fixes the destroy segfault on NULL termcap struct
Marking new because of the patch, and setting priority to High, and severity to major because of the segfault. The system is broken if there is no termcap, but we shouldn't segfault.
Commited.