1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(CI): Disallow implicit casting of QByteArray to char* or void*

QByteArray usually holds arbitrary binary data, which can have null
characters or invalid characters when converted to ASCII or UTF8.
Disallow implicit casting for safety, forcing an explicit decision if
the conversion is wanted.
This commit is contained in:
Anthony Bilinski 2022-04-03 01:07:28 -07:00
parent 1e4eed76b5
commit f1b401166a
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
2 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,8 @@ if (UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro")
endif() endif()
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
include(CheckAtomic) include(CheckAtomic)
# Use ccache when available to speed up builds. # Use ccache when available to speed up builds.

View File

@ -57,7 +57,7 @@ QVector<VideoMode> avfoundation::getDeviceModes(QString devName)
return result; return result;
} }
else { else {
NSString* deviceName = [NSString stringWithCString:devName.toUtf8() encoding:NSUTF8StringEncoding]; NSString* deviceName = [NSString stringWithCString:devName.toUtf8().constData() encoding:NSUTF8StringEncoding];
AVCaptureDevice* device = [AVCaptureDevice deviceWithUniqueID:deviceName]; AVCaptureDevice* device = [AVCaptureDevice deviceWithUniqueID:deviceName];
if (device == nil) { if (device == nil) {