commit 1055745cdb90208fed5c5abd20f81cbe0d5be927
Author: Jakub Bogusz <[email protected]>
Date:   Wed Oct 2 20:52:08 2024 +0200

    - added workaround for trauncation warning on x86_64

 cpprestsdk-truncation.patch | 11 +++++++++++
 cpprestsdk.spec             |  2 ++
 2 files changed, 13 insertions(+)
---
diff --git a/cpprestsdk.spec b/cpprestsdk.spec
index 0cf8787..ddce444 100644
--- a/cpprestsdk.spec
+++ b/cpprestsdk.spec
@@ -7,6 +7,7 @@ License:        MIT
 Group:         Libraries
 Source0:       
https://github.com/microsoft/cpprestsdk/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5: a7f8a8b55cd2f799cb9d712f172b1af1
+Patch0:                %{name}-truncation.patch
 URL:           https://github.com/microsoft/cpprestsdk
 BuildRequires: boost-devel
 BuildRequires: cmake >= 3.9
@@ -52,6 +53,7 @@ Pliki nagłówkowe biblioteki cpprest.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 install -d build
diff --git a/cpprestsdk-truncation.patch b/cpprestsdk-truncation.patch
new file mode 100644
index 0000000..0cdb9ca
--- /dev/null
+++ b/cpprestsdk-truncation.patch
@@ -0,0 +1,11 @@
+cpprestsdk-2.10.19/Release/src/http/common/http_helpers.cpp:91:43: error: 
'%8zX' directive output may be truncated writing between 8 and 16 bytes into a 
region of size 9 [-Werror=format-truncation=]
+--- cpprestsdk-2.10.19/Release/src/http/common/http_helpers.cpp.orig   
2023-12-05 05:23:31.000000000 +0100
++++ cpprestsdk-2.10.19/Release/src/http/common/http_helpers.cpp        
2024-10-02 20:00:01.788666800 +0200
+@@ -88,6 +88,7 @@ size_t chunked_encoding::add_chunked_del
+ #ifdef _WIN32
+         sprintf_s(buffer, sizeof(buffer), "%8IX", bytes_read);
+ #else
++      if (sizeof(bytes_read) > 4 && bytes_read > 0xFFFFFFFF) bytes_read = 
0xFFFFFFFF;
+         snprintf(buffer, sizeof(buffer), "%8zX", bytes_read);
+ #endif
+         memcpy(&data[0], buffer, 8);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cpprestsdk.git/commitdiff/1055745cdb90208fed5c5abd20f81cbe0d5be927

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to