linter: don't try to access absent stat info, as that gives a crash
This fixes https://savannah.gnu.org/bugs/?53981.master
parent
86c08560ad
commit
ac31669ec3
10
src/text.c
10
src/text.c
|
@ -3267,16 +3267,18 @@ void do_linter(void)
|
||||||
struct stat lintfileinfo;
|
struct stat lintfileinfo;
|
||||||
|
|
||||||
if (stat(curlint->filename, &lintfileinfo) != -1 &&
|
if (stat(curlint->filename, &lintfileinfo) != -1 &&
|
||||||
openfile->current_stat->st_ino != lintfileinfo.st_ino) {
|
(openfile->current_stat == NULL ||
|
||||||
|
openfile->current_stat->st_ino != lintfileinfo.st_ino)) {
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
const openfilestruct *started_at = openfile;
|
const openfilestruct *started_at = openfile;
|
||||||
|
|
||||||
openfile = openfile->next;
|
openfile = openfile->next;
|
||||||
while (openfile != started_at &&
|
while (openfile != started_at && (openfile->current_stat == NULL ||
|
||||||
openfile->current_stat->st_ino != lintfileinfo.st_ino)
|
openfile->current_stat->st_ino != lintfileinfo.st_ino))
|
||||||
openfile = openfile->next;
|
openfile = openfile->next;
|
||||||
|
|
||||||
if (openfile->current_stat->st_ino != lintfileinfo.st_ino) {
|
if (openfile->current_stat == NULL ||
|
||||||
|
openfile->current_stat->st_ino != lintfileinfo.st_ino) {
|
||||||
char *msg = charalloc(1024 + strlen(curlint->filename));
|
char *msg = charalloc(1024 + strlen(curlint->filename));
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue