Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
aaaaae66e1
!7 Coverity CID 1373522: Fix memory leak
From: @ultra_planet 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2024-08-02 02:24:19 +00:00
lingsheng
046c3b75ba Coverity CID 1373522: Fix memory leak 2024-07-31 01:48:02 +00:00
openeuler-ci-bot
a3177bbbfc
!5 update to 1.2.4
From: @zhouwenpei 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2022-11-08 11:31:04 +00:00
zhouwenpei
c964494047 update to 1.2.4 2022-11-03 07:01:41 +00:00
openeuler-ci-bot
4bf798a572
!4 [sync] PR-2: 【轻量级 PR】:Rebuild for next release
From: @openeuler-sync-bot 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2022-10-28 08:29:47 +00:00
zhouwenpei
179be63536 Rebuild for next release
Signed-off-by: zhouwenpei <zhouwenpei050@chinasoftinc.com>
(cherry picked from commit d412ef0dc83ca1aa140435e00ae90f594ef5e081)
2022-10-27 14:44:32 +08:00
openeuler-ci-bot
a57db41237 !1 add yaml file in package
Merge pull request !1 from maqiang/master
2020-07-21 12:11:42 +08:00
maqiang
08119d87a0 update libXtst.yaml. 2020-07-21 11:50:03 +08:00
maqiang999
a429440f07 add yaml file in package 2020-06-13 14:55:00 +08:00
zhuchunyi
72408118c8 update code 2019-11-06 19:36:36 +08:00
5 changed files with 167 additions and 4 deletions

View File

@ -0,0 +1,141 @@
From 1e8215d8b4c85343da4301cd022639ae5f36756c Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@NetBSD.org>
Date: Wed, 28 Sep 2022 09:46:26 +0200
Subject: [PATCH] Coverity CID 1373522: Fix memory leak
Signed-off-by: Thomas Klausner <wiz@gatalith.at>
---
src/XRecord.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/XRecord.c b/src/XRecord.c
index 6c9b54e..e5357b9 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -725,13 +725,14 @@ parse_reply_call_callback(
XRecordInterceptProc callback,
XPointer closure)
{
+ XRecordInterceptData *data;
unsigned int current_index;
int datum_bytes = 0;
/* call the callback for each protocol element in the reply */
current_index = 0;
do {
- XRecordInterceptData *data = alloc_inter_data(info);
+ data = alloc_inter_data(info);
if (!data)
return Error;
@@ -754,15 +755,15 @@ parse_reply_call_callback(
current_index += 4;
}
if (current_index + 1 > rep->length << 2)
- return Error;
+ goto out;
switch (reply->buf[current_index]) {
case X_Reply: /* reply */
if (current_index + 8 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD32(rep->clientSwapped,
reply->buf+current_index+4, datum_bytes);
if (datum_bytes < 0 || datum_bytes > ((INT_MAX >> 2) - 8))
- return Error;
+ goto out;
datum_bytes = (datum_bytes+8) << 2;
break;
default: /* error or event */
@@ -772,7 +773,7 @@ parse_reply_call_callback(
case XRecordFromClient:
if (rep->elementHeader&XRecordFromClientTime) {
if (current_index + 4 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD32(rep->clientSwapped,
reply->buf+current_index,
data->server_time);
@@ -780,19 +781,19 @@ parse_reply_call_callback(
}
if (rep->elementHeader&XRecordFromClientSequence) {
if (current_index + 4 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD32(rep->clientSwapped,
reply->buf+current_index,
data->client_seq);
current_index += 4;
}
if (current_index + 4 > rep->length<<2)
- return Error;
+ goto out;
if (reply->buf[current_index+2] == 0
&& reply->buf[current_index+3] == 0) /* needn't swap 0 */
{ /* BIG-REQUESTS */
if (current_index + 8 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD32(rep->clientSwapped,
reply->buf+current_index+4, datum_bytes);
} else {
@@ -800,12 +801,12 @@ parse_reply_call_callback(
reply->buf+current_index+2, datum_bytes);
}
if (datum_bytes < 0 || datum_bytes > INT_MAX >> 2)
- return Error;
+ goto out;
datum_bytes <<= 2;
break;
case XRecordClientStarted:
if (current_index + 8 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD16(rep->clientSwapped,
reply->buf+current_index+6, datum_bytes);
datum_bytes = (datum_bytes+2) << 2;
@@ -813,19 +814,19 @@ parse_reply_call_callback(
case XRecordClientDied:
if (rep->elementHeader&XRecordFromClientSequence) {
if (current_index + 4 > rep->length << 2)
- return Error;
+ goto out;
EXTRACT_CARD32(rep->clientSwapped,
reply->buf+current_index,
data->client_seq);
current_index += 4;
} else if (current_index < rep->length << 2)
- return Error;
+ goto out;
datum_bytes = 0;
break;
case XRecordStartOfData:
case XRecordEndOfData:
if (current_index < rep->length << 2)
- return Error;
+ goto out;
datum_bytes = 0;
break;
}
@@ -836,7 +837,7 @@ parse_reply_call_callback(
"XRecord: %lu-byte reply claims %d-byte element (seq %lu)\n",
(unsigned long)rep->length << 2, current_index + datum_bytes,
dpy->last_request_read);
- return Error;
+ goto out;
}
/*
* This assignment (and indeed the whole buffer sharing
@@ -859,6 +860,9 @@ parse_reply_call_callback(
return End;
return Continue;
+out:
+ Xfree(data);
+ return Error;
}
Status
--
2.33.0

Binary file not shown.

BIN
libXtst-1.2.4.tar.gz Normal file

Binary file not shown.

View File

@ -1,10 +1,12 @@
Summary: X.Org X11 libXtst runtime library Summary: X.Org X11 libXtst runtime library
Name: libXtst Name: libXtst
Version: 1.2.3 Version: 1.2.4
Release: 9 Release: 2
License: MIT License: MIT
URL: https://www.x.org URL: https://www.x.org
Source0: https://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}.tar.bz2 Source0: https://xorg.freedesktop.org/archive/individual/lib/%{name}-%{version}.tar.gz
Patch0: backport-Coverity-CID-1373522-Fix-memory-leak.patch
Requires: libX11 >= 1.5.99.902 Requires: libX11 >= 1.5.99.902
@ -40,7 +42,7 @@ autoreconf -ivf
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING %license COPYING
%{_libdir}/*.so.* %{_libdir}/*.so.*
%exclude %{_docdir} %exclude %{_docdir}
@ -57,5 +59,20 @@ autoreconf -ivf
%{_mandir}/man3/XTest*.3* %{_mandir}/man3/XTest*.3*
%changelog %changelog
* Tue Jul 30 2024 lingsheng <lingsheng1@h-partners.com> - 1.2.4-2
- Coverity CID 1373522: Fix memory leak
* Thu Nov 03 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 1.2.4-1
- update 1.2.4
* Wed Oct 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 1.2.3-11
- Rebuild for next release
* Sat Oct 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.2.3-10
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:change the directory of the license file
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.2.3-9 * Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.2.3-9
- Package init - Package init

5
libXtst.yaml Normal file
View File

@ -0,0 +1,5 @@
version_control: git
src_repo: https://gitlab.freedesktop.org/xorg/lib/libxtst.git
tag_prefix: libXtst-
seperator: "."