diff options
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.patch | 42 |
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 @@ | |||
1 | From 53afe73154c7c00b54cd280fa3d6c9127a2bc84b Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Liu <net147@gmail.com> | ||
3 | Date: Mon, 9 Mar 2015 22:35:56 +1100 | ||
4 | Subject: [PATCH] Unix: Clear serial_struct instances | ||
5 | |||
6 | Silences the following Valgrind warning: | ||
7 | Conditional jump or move depends on uninitialised value(s) | ||
8 | |||
9 | Upstream-Status: Backport from 5.5 branch | ||
10 | |||
11 | Change-Id: I8fd8cfd6aa6f75ed515e6151cfc282faca508bdc | ||
12 | Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> | ||
13 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
14 | --- | ||
15 | src/serialport/qserialport_unix.cpp | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp | ||
19 | index 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(¤tSerialInfo, 0, sizeof(currentSerialInfo)); | ||
27 | + | ||
28 | if ((::ioctl(descriptor, TIOCGSERIAL, ¤tSerialInfo) != -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(¤tSerialInfo, 0, sizeof(currentSerialInfo)); | ||
36 | + | ||
37 | if (::ioctl(descriptor, TIOCGSERIAL, ¤tSerialInfo) == -1) | ||
38 | return decodeSystemError(); | ||
39 | |||
40 | -- | ||
41 | 2.3.2 | ||
42 | |||