From 1efddaf1e5a8da0406f336c85491f2fd720d6860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 15 Sep 2020 19:56:52 +0200 Subject: [PATCH] Check for fdopen failure in OpenFilesScreen_getProcessData --- OpenFilesScreen.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 323913dd..915aba22 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -88,6 +88,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { OpenFiles_FileData* fdata = NULL; FILE* fd = fdopen(fdpair[0], "r"); + if (!fd) { + pdata->error = 1; + return pdata; + } for (;;) { char* line = String_readLine(fd); if (!line) {