!116 Fix clang incompatible function pointer error

From: @yanyir 
Reviewed-by: @liyunfei33, @luofeng14, @wk333 
Signed-off-by: @wk333
This commit is contained in:
openeuler-ci-bot 2024-09-09 01:24:47 +00:00 committed by Gitee
commit e133a76d57
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 54 additions and 2 deletions

View File

@ -0,0 +1,48 @@
From 0a35fd99e25e085a4826a7e5af4711034fec2eed Mon Sep 17 00:00:00 2001
From: yanying <201250106@smail.nju.edu.cn>
Date: Mon, 5 Aug 2024 23:42:40 +0800
Subject: [PATCH] Fix clang incompatible function pointer error
---
libfreerdp/codec/rfx.c | 4 ++--
winpr/include/winpr/collections.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c
index ccbc5afe4..eec736558 100644
--- a/libfreerdp/codec/rfx.c
+++ b/libfreerdp/codec/rfx.c
@@ -153,7 +153,7 @@ static void rfx_tile_init(void* obj)
}
}
-static void* rfx_decoder_tile_new(void* val)
+static void* rfx_decoder_tile_new(const void* val)
{
RFX_TILE* tile = NULL;
WINPR_UNUSED(val);
@@ -184,7 +184,7 @@ static void rfx_decoder_tile_free(void* obj)
}
}
-static void* rfx_encoder_tile_new(void* val)
+static void* rfx_encoder_tile_new(const void* val)
{
WINPR_UNUSED(val);
return calloc(1, sizeof(RFX_TILE));
diff --git a/winpr/include/winpr/collections.h b/winpr/include/winpr/collections.h
index 807f011d7..b8c8d9d66 100644
--- a/winpr/include/winpr/collections.h
+++ b/winpr/include/winpr/collections.h
@@ -36,7 +36,7 @@ extern "C"
{
#endif
- typedef void* (*OBJECT_NEW_FN)(void* val);
+ typedef void* (*OBJECT_NEW_FN)(const void* val);
typedef void (*OBJECT_INIT_FN)(void* obj);
typedef void (*OBJECT_UNINIT_FN)(void* obj);
typedef void (*OBJECT_FREE_FN)(void* obj);
--
2.41.0.windows.1

View File

@ -1,6 +1,6 @@
Name: freerdp
Version: 2.11.7
Release: 2
Release: 3
Epoch: 2
Summary: A Remote Desktop Protocol Implementation
License: Apache-2.0
@ -8,7 +8,8 @@ URL: http://www.freerdp.com
Source0: https://github.com/FreeRDP/FreeRDP/releases/download/%{version}/freerdp-%{version}.tar.gz
Patch0001: Fix-freerdp-shadow-cli-exit-codes-for-help-and-version.patch
Patch0002: CVE-2024-32661.patch
Patch0002: CVE-2024-32661.patch
Patch0003: Fix-clang-incompatible-function-pointer-error.patch
BuildRequires: gcc gcc-c++ alsa-lib-devel cmake >= 2.8 cups-devel gsm-devel libXrandr-devel libXv-devel
BuildRequires: libjpeg-turbo-devel libjpeg-turbo-devel libX11-devel libXcursor-devel libxkbfile-devel
@ -138,6 +139,9 @@ echo "%{_libdir}/freerdp2" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_
%{_mandir}/*/*
%changelog
* Mon Aug 05 2024 yanying <201250106@smail.nju.edu.cn> - 2:2.11.7-3
- Fix clang incompatible function pointer error
* Mon May 06 2024 wangkai <13474090681@163.com> - 2:2.11.7-2
- Fix CVE-2024-32661