diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-09-17 19:06:07 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-17 19:11:33 +0200 |
commit | d3dc5cdcb301795c46b1f99430f776bb110724a3 (patch) | |
tree | fdd26457b4b9876a353ca744140840cd30afa578 | |
parent | a966d37a21d814d5e2205b86b77fe6877c0a8deb (diff) |
Fix warnings on OpenWrt CCs, caused by the memcpy builtin.improved/openwrt-xcc-builtin-memcpy-warning
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>
-rw-r--r-- | src/lib/protocols/quic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 7889dad4d..4909846b1 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -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; } |