summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch')
-rw-r--r--recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch b/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch
new file mode 100644
index 00000000..b14cf013
--- /dev/null
+++ b/recipes-qt/qt5/qtserialport-git/0001-Unix-Clear-serial_struct-instances.patch
@@ -0,0 +1,42 @@
1From 53afe73154c7c00b54cd280fa3d6c9127a2bc84b Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Mon, 9 Mar 2015 22:35:56 +1100
4Subject: [PATCH] Unix: Clear serial_struct instances
5
6Silences the following Valgrind warning:
7Conditional jump or move depends on uninitialised value(s)
8
9Upstream-Status: Backport from 5.5 branch
10
11Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc
12Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14---
15 src/serialport/qserialport_unix.cpp | 4 ++++
16 1 file changed, 4 insertions(+)
17
18diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
19index 34ef41d..7cf356b 100644
20--- a/src/serialport/qserialport_unix.cpp
21+++ b/src/serialport/qserialport_unix.cpp
22@@ -439,6 +439,8 @@ QSerialPortPrivate::setStandardBaudRate(qint32 baudRate, QSerialPort::Directions
23 {
24 struct serial_struct currentSerialInfo;
25
26+ ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
27+
28 if ((::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) != -1)
29 && (currentSerialInfo.flags & ASYNC_SPD_CUST)) {
30 currentSerialInfo.flags &= ~ASYNC_SPD_CUST;
31@@ -469,6 +471,8 @@ QSerialPortPrivate::setCustomBaudRate(qint32 baudRate, QSerialPort::Directions d
32
33 struct serial_struct currentSerialInfo;
34
35+ ::memset(&currentSerialInfo, 0, sizeof(currentSerialInfo));
36+
37 if (::ioctl(descriptor, TIOCGSERIAL, &currentSerialInfo) == -1)
38 return decodeSystemError();
39
40--
412.3.2
42