Fix warnings on OpenWrt CCs, caused by the memcpy builtin. (#1741)

In file included from ../include/ndpi_includes.h:31,
                 from ../include/ndpi_main.h:27,
                 from ../include/ndpi_api.h:28,
                 from protocols/quic.c:27:
In function 'memcpy',
    inlined from 'tls13_hkdf_expand_label_context' at protocols/quic.c:473:5,
    inlined from 'tls13_hkdf_expand_label' at protocols/quic.c:498:10,
    inlined from 'quic_hkdf_expand_label.constprop' at protocols/quic.c:512:6:
/home/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-11.3.0_musl/include/fortify/string.h:53:16: error: argument 2 null where non-null expected [-Werror=nonnull]
   53 |         return __builtin_memcpy(__od, __os, __n);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
protocols/quic.c: In function 'quic_hkdf_expand_label.constprop':
/home/build/openwrt/staging_dir/toolchain-mips_24kc_gcc-11.3.0_musl/include/fortify/string.h:53:16: note: in a call to built-in function '__builtin_memcpy'

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni
2022-09-18 12:40:49 +02:00
committed by GitHub
parent 48d00eae35
commit 174cd739db
+1 -1
View File
@@ -469,7 +469,7 @@ static int tls13_hkdf_expand_label_context(struct ndpi_detection_module_struct *
memcpy(&info_data[info_len], &context_length, 1);
info_len += 1;
if(context_length) {
if(context_length && context_hash != NULL) {
memcpy(&info_data[info_len], context_hash, context_length);
info_len += context_length;
}