Skip to content

QPulseAudioSource: fix UB (memcpy() called with nullptr dest) in read()

deviceReady() calls read(nullptr, 0), but calling memcpy() with a nullpt destination is UB, even if the length is simulateneously zero.

Ditto applyVolume() (called from read()).

Fix by guarding the memcpy() calls.

Add assertions to indicate that for these functions, nullptr is valid input iff length is zero.

Found by clangsa's core.NonNullParamChecker.

Pick-to: 6.3 6.2 5.15 Change-Id: I9006b0e933e196a7a212e0ebe2bd27f6b9552518 Reviewed-by: Rafael Roquetto rafael.roquetto@qt.io (cherry picked from commit 8df415d5)

Merge request reports