Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0055-libUPnP-Fix-some-UB-like-memcpy.patch
blob7089b4e3f8f624952ae908a11a5fc07ba1391825
1 From 6b0bc3602465eede68f1e04cf4835d1347bc9d69 Mon Sep 17 00:00:00 2001
2 From: Yu Xiao <1918256943@qq.com>
3 Date: Fri, 11 Oct 2024 18:02:35 +0800
4 Subject: [PATCH] fix some UB like memcpy(NULL, NULL, 0)
6 ---
7 lib/libUPnP/Neptune/Source/Core/NptUtils.cpp | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
10 diff --git a/lib/libUPnP/Neptune/Source/Core/NptUtils.cpp b/lib/libUPnP/Neptune/Source/Core/NptUtils.cpp
11 index f427f8b..b2a641c 100644
12 --- a/lib/libUPnP/Neptune/Source/Core/NptUtils.cpp
13 +++ b/lib/libUPnP/Neptune/Source/Core/NptUtils.cpp
14 @@ -376,7 +376,7 @@ NPT_HexString(const unsigned char* data,
15 while (data_size--) {
16 NPT_ByteToHex(*src++, dst, uppercase);
17 dst += 2;
18 - if (data_size) {
19 + if (data_size && separator_length) {
20 NPT_CopyMemory(dst, separator, separator_length);
21 dst += separator_length;
24 2.44.0.windows.1