From 1bad22036b56c4988a06b1b245b8f69262f223be Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Debian Linux)" <rob@synchro.net> Date: Thu, 11 Jan 2024 00:31:53 -0800 Subject: [PATCH] Another fix for the read() reutrn value FORTIFY warning that doesn't log an error --- src/sbbs3/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 0983d194e0..3998982c9e 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -3055,8 +3055,9 @@ void event_thread(void* arg) sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr=0; if(file!=-1) { lseek(file,sbbs->cfg.sub[sbbs->cfg.qhub[i]->sub[j]->subnum]->ptridx*sizeof(int32_t),SEEK_SET); - (void)read(file,&sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr - ,sizeof(sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr)); + if(read(file,&sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr + ,sizeof(sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr)) != sizeof(uint32_t)) + sbbs->subscan[sbbs->cfg.qhub[i]->sub[j]->subnum].ptr = 0; } } if(file!=-1) -- GitLab