In file included from source3/include/includes.h:23,
from source3/lib/dbwrap/dbwrap_watch.c:20:
source3/lib/dbwrap/dbwrap_watch.c: In function ‘dbwrap_watched_watch_remove_instance’:
lib/replace/replace.h:850:24: error: ‘memset_explicit’ writing 32 bytes into a
region of size 24 overflows the destination [-Werror=stringop-overflow=]
GCC 15's -Wstringop-overflow analysis of memset_explicit (via the ZERO_STRUCT
macro) tracks the pointer through the (char *) cast and misidentifies the
destination as the first member pid (24 bytes) rather than the enclosing struct
dbwrap_watcher (32 bytes). This is a GCC false positive.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
DBG_DEBUG("Watcher %s:%"PRIu64" reverted from adding\n",
server_id_str_buf(clear_watcher.pid, &buf),
clear_watcher.instance);
- ZERO_STRUCT(wrec->added);
+ wrec->added = (struct dbwrap_watcher) { 0 };
}
for (i=0; i < wrec->watchers.count; i++) {