fix null pointer dereference problems
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn> (cherry picked from commit d17aaac7d88c150dea03d26e9a9615c3f374a89d)
This commit is contained in:
parent
383a0a8ac8
commit
3f76ce1dc0
65
0001-fix-possible-null-pointer-derefrence-problem.patch
Normal file
65
0001-fix-possible-null-pointer-derefrence-problem.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
From c1a32c45afa855547cd9b7aabc87fc16f7ec28f3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
|
||||||
|
Date: Sun, 28 Apr 2024 10:06:12 +0800
|
||||||
|
Subject: [PATCH] fix possible null pointer derefrence problem
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
|
||||||
|
---
|
||||||
|
ukcc-bluetooth/bluetoothmain.cpp | 10 +++++-----
|
||||||
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ukcc-bluetooth/bluetoothmain.cpp b/ukcc-bluetooth/bluetoothmain.cpp
|
||||||
|
index 7370c3f..22fb70f 100644
|
||||||
|
--- a/ukcc-bluetooth/bluetoothmain.cpp
|
||||||
|
+++ b/ukcc-bluetooth/bluetoothmain.cpp
|
||||||
|
@@ -398,7 +398,7 @@ bluetoothadapter * BlueToothMain::createOneBluetoothAdapter(QString adapter_addr
|
||||||
|
if (adapter_dev_name.isEmpty())
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "name is null!" << __LINE__;
|
||||||
|
- adapter_dev->deleteLater();
|
||||||
|
+ //adapter_dev->deleteLater();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -409,7 +409,7 @@ bluetoothadapter * BlueToothMain::createOneBluetoothAdapter(QString adapter_addr
|
||||||
|
if (adapter_address == tmpDev->getDevAddress())
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "device existing!" << __LINE__;
|
||||||
|
- adapter_dev->deleteLater();
|
||||||
|
+ //adapter_dev->deleteLater();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -687,7 +687,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||||||
|
if (dev_name.isEmpty())
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "name is null!" << __LINE__;
|
||||||
|
- dev->deleteLater();
|
||||||
|
+ //dev->deleteLater();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -699,7 +699,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||||||
|
if(isInvalidDevice(dev_name,dev_type))
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "isInvalidDevice!" << __LINE__;
|
||||||
|
- dev->deleteLater();
|
||||||
|
+ //dev->deleteLater();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -709,7 +709,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||||||
|
if (devAddress == tmpDev->getDevAddress())
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "device existing!" << __LINE__;
|
||||||
|
- dev->deleteLater();
|
||||||
|
+ //dev->deleteLater();
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@ -1,10 +1,11 @@
|
|||||||
Name: ukui-bluetooth
|
Name: ukui-bluetooth
|
||||||
Version: 1.0.3
|
Version: 1.0.3
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: Advanced ukui bluetooth
|
Summary: Advanced ukui bluetooth
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.ukui.org
|
URL: http://www.ukui.org
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
Patch01: 0001-fix-possible-null-pointer-derefrence-problem.patch
|
||||||
|
|
||||||
BuildRequires: gsettings-qt-devel
|
BuildRequires: gsettings-qt-devel
|
||||||
BuildRequires: glib2-devel
|
BuildRequires: glib2-devel
|
||||||
@ -30,6 +31,7 @@ A lightweight Bluetooth tool based on libkf5bluezqt6 on the UKUI desktop environ
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch 1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
@ -73,6 +75,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun Apr 28 2024 houhongxun <houhongxun@kylinos.cn> - 1.0.3-4
|
||||||
|
- fix null pointer dereference problems
|
||||||
|
|
||||||
* Sat Apr 08 2023 douyan <douyan@kylinos.cn> - 1.0.3-3
|
* Sat Apr 08 2023 douyan <douyan@kylinos.cn> - 1.0.3-3
|
||||||
- add requires pulseaudio-module-bluetooth
|
- add requires pulseaudio-module-bluetooth
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user