From f5cf7917fb78e7414bc2bd164777cf1309c68ccf Mon Sep 17 00:00:00 2001 From: bol-van Date: Fri, 24 Jan 2025 20:57:12 +0300 Subject: [PATCH] nfqws,tpws: file_mod_signature zero struct if unsuccessful --- nfq/helpers.c | 6 +++++- tpws/helpers.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nfq/helpers.c b/nfq/helpers.c index 03f130c..2e4727d 100644 --- a/nfq/helpers.c +++ b/nfq/helpers.c @@ -303,7 +303,11 @@ time_t file_mod_time(const char *filename) bool file_mod_signature(const char *filename, file_mod_sig *ms) { struct stat st; - if (stat(filename,&st)==-1) return false; + if (stat(filename,&st)==-1) + { + FILE_MOD_RESET(ms); + return false; + } ms->mod_time=st.st_mtime; ms->size=st.st_size; return true; diff --git a/tpws/helpers.c b/tpws/helpers.c index b4f4ba3..7db6aac 100644 --- a/tpws/helpers.c +++ b/tpws/helpers.c @@ -317,7 +317,11 @@ time_t file_mod_time(const char *filename) bool file_mod_signature(const char *filename, file_mod_sig *ms) { struct stat st; - if (stat(filename,&st)==-1) return false; + if (stat(filename,&st)==-1) + { + FILE_MOD_RESET(ms); + return false; + } ms->mod_time=st.st_mtime; ms->size=st.st_size; return true;