Mailing List Archive

[MythTV/mythtv] 33c2ad: Fix potential null pointer dereferences in playbac...
Branch: refs/heads/master
Home: https://github.com/MythTV/mythtv
Commit: 33c2ad744a092147282612faba042e90370fff7e
https://github.com/MythTV/mythtv/commit/33c2ad744a092147282612faba042e90370fff7e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-12 (Wed, 12 Jul 2023)

Changed paths:
M mythtv/programs/mythfrontend/playbackboxhelper.cpp

Log Message:
-----------
Fix potential null pointer dereferences in playbackboxhelper.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Rewrite the code to remember the first availability type instead of
retrieving it from the set.


Commit: d5788c26a3892d512e7171ecc4c6433e8d37005e
https://github.com/MythTV/mythtv/commit/d5788c26a3892d512e7171ecc4c6433e8d37005e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-12 (Wed, 12 Jul 2023)

Changed paths:
M mythtv/programs/mythfrontend/actionset.cpp

Log Message:
-----------
Fix potential null pointer dereferences in actionset.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator. Prior checks for !empty() do not help, as another
thread could have removed the last item between the time of the empty
check and the time of the begin call.

Rewrite the code to eliminate these warnings.


Commit: 3b564a8717e6bed9e28cf46a8c1fe9549f01ad6d
https://github.com/MythTV/mythtv/commit/3b564a8717e6bed9e28cf46a8c1fe9549f01ad6d
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-12 (Wed, 12 Jul 2023)

Changed paths:
M mythtv/programs/mythbackend/autoexpire.cpp

Log Message:
-----------
Fix potential null pointer dereferences in autoexpire.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.


Commit: d198f1158a7fa989348e4090f6561d3a58b12194
https://github.com/MythTV/mythtv/commit/d198f1158a7fa989348e4090f6561d3a58b12194
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-12 (Wed, 12 Jul 2023)

Changed paths:
M mythtv/libs/libmythprotoserver/mythsocketmanager.cpp

Log Message:
-----------
Fix potential null pointer dereferences in mythsocketmanager.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator. Prior checks for !empty() do not help, as another
thread could have removed the last item between the time of the empty
check and the time of the begin call.

Rewrite the code to eliminate this warning.


Commit: 19315dd9d7803c3697c545f01ce0a12824b231f4
https://github.com/MythTV/mythtv/commit/19315dd9d7803c3697c545f01ce0a12824b231f4
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythbase/mthreadpool.cpp

Log Message:
-----------
Fix potential null pointer dereferences in mthreadpool.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Rewriting the while loop as a for loop eliminates the compiler
warning.


Commit: c2ed61b21cd60133cdf9f7ee1fe6b0382d0e1109
https://github.com/MythTV/mythtv/commit/c2ed61b21cd60133cdf9f7ee1fe6b0382d0e1109
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythui/mythmainwindow.cpp

Log Message:
-----------
Fix potential null pointer dereference in mythmainwindow.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Rewrite the code slightly so that the compiler checks recognize that
the iterator has been validated before its value is retrieved.


Commit: ef98d0a1dc097ca707a1e0f76157d1346766effa
https://github.com/MythTV/mythtv/commit/ef98d0a1dc097ca707a1e0f76157d1346766effa
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythui/mythuiimage.cpp

Log Message:
-----------
Fix potential null pointer dereference in mythuiimage.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Rewriting the "while" loop as a "for" loop allows the compiler to
validate that the iterator is valid before its value is used.


Commit: 3c80c01671dba20f2923d8b20ae1bec9d6306712
https://github.com/MythTV/mythtv/commit/3c80c01671dba20f2923d8b20ae1bec9d6306712
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp

Log Message:
-----------
Fix potential null pointer dereference in channelscan_sm.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Rewrite the initial value checks so the code has access to the
iterators. Use the already validated iterator for the rest of the
function instead of calling find() a second time.


Commit: 87532d6c001c1c3ad15f34cedd37d453802ee16d
https://github.com/MythTV/mythtv/commit/87532d6c001c1c3ad15f34cedd37d453802ee16d
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythtv/recorders/recorderbase.cpp

Log Message:
-----------
Fix potential null pointer dereference in TryWriteProgStartMark.

Recent changes to Qt6 or the compiler have produced new null pointer
dereference warnings. Apparently every call to a begin()/find()
function has a code path that can return the end() iterator (which
makes sense), and dereferencing the end() iterator in Qt6 is a null
pointer dereference. This means that any call to a function returning
an iterator must be followed by a validity test before dereferencing
that iterator.

Instead of dereferencing begin() multiple times, get an iterator to
the first item in the QMap, validate it, and then use that iterator
for all future references.


Commit: 32b165c2474ea9ea9fd52eb9d37f8f7d47102c6e
https://github.com/MythTV/mythtv/commit/32b165c2474ea9ea9fd52eb9d37f8f7d47102c6e
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp

Log Message:
-----------
Fix potential string over-read in mythraopconnection.

Recent changes to Qt6 or the compiler have produced new compiler
warnings. In this case the compiler thinks it is trying to copy six
bytes from an empty QByteArray. Add a length check to ensure that the
are enough bytes in the copy source.


Commit: 0b8c12a3a647521e8dcaab0d55c55081cfa3c798
https://github.com/MythTV/mythtv/commit/0b8c12a3a647521e8dcaab0d55c55081cfa3c798
Author: David Hampton <mythtv@love2code.net>
Date: 2023-07-18 (Tue, 18 Jul 2023)

Changed paths:
M mythtv/libs/libmythbase/mthreadpool.cpp
M mythtv/libs/libmythprotoserver/mythsocketmanager.cpp
M mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp
M mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
M mythtv/libs/libmythtv/recorders/recorderbase.cpp
M mythtv/libs/libmythui/mythmainwindow.cpp
M mythtv/libs/libmythui/mythuiimage.cpp
M mythtv/programs/mythbackend/autoexpire.cpp
M mythtv/programs/mythfrontend/actionset.cpp
M mythtv/programs/mythfrontend/playbackboxhelper.cpp

Log Message:
-----------
Fix a number of potential null pointer dereferences.


Compare: https://github.com/MythTV/mythtv/compare/e8c4dfa777b9...0b8c12a3a647
_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-commits