mirror of
https://github.com/samba-team/samba.git
synced 2025-01-05 09:18:06 +03:00
8e7a62b6ff
We use strlcpy() which has been added to glibc recently. This means we also get fortification for strlcpy() now: source3/nmbd/nmbd_browsesync.c: In function ‘find_domain_master_name_query_success’: source3/nmbd/nmbd_browsesync.c:337:9: warning: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination [-Wstringop-overflow=] 337 | strlcpy(userdata->data, work->work_group, size - sizeof(*userdata)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We allocate memory for the userdata struct + fstring. However the data pointer we use only is 16 bytes. Also nowadays you would use offsetof() for the allocation calculation, but it only works correctly on newer compilers like gcc > 7. We could make use of it in future after CentOS 7 is gone. As we don't want to touch nmbd anymore, just silence the warnings. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> |
||
---|---|---|
.. | ||
asyncdns.c | ||
nmbd_become_dmb.c | ||
nmbd_become_lmb.c | ||
nmbd_browserdb.c | ||
nmbd_browsesync.c | ||
nmbd_elections.c | ||
nmbd_incomingdgrams.c | ||
nmbd_incomingrequests.c | ||
nmbd_lmhosts.c | ||
nmbd_logonnames.c | ||
nmbd_mynames.c | ||
nmbd_namelistdb.c | ||
nmbd_namequery.c | ||
nmbd_nameregister.c | ||
nmbd_namerelease.c | ||
nmbd_nodestatus.c | ||
nmbd_packets.c | ||
nmbd_processlogon.c | ||
nmbd_proto.h | ||
nmbd_responserecordsdb.c | ||
nmbd_sendannounce.c | ||
nmbd_serverlistdb.c | ||
nmbd_subnetdb.c | ||
nmbd_synclists.c | ||
nmbd_winsproxy.c | ||
nmbd_winsserver.c | ||
nmbd_workgroupdb.c | ||
nmbd.c | ||
nmbd.h | ||
wscript_build |