Skip to content

Commit

Permalink
Fix nullptr check for hid input data
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Oct 18, 2024
1 parent 9461db4 commit afa2840
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VoodooRMI/Functions/F11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void F11::attention(AbsoluteTime time, UInt8 *data[], size_t *size)
size_t fingers;
UInt8 finger_state;

if (data) {
if (*data) {
if (*size < attn_size) {
IOLogError("F11 attention larger than remaining data");
return;
Expand Down
2 changes: 1 addition & 1 deletion VoodooRMI/Functions/F12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void F12::attention(AbsoluteTime time, UInt8 *data[], size_t *size)
if (!data1)
return;

if (data) {
if (*data) {
if (*size < attn_size) {
IOLogError("F12 attention larger than remaining data");
return;
Expand Down
2 changes: 1 addition & 1 deletion VoodooRMI/Functions/Input/RMIFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool RMIFunction::start(IOService *provider) {
}

bool RMIFunction::getInputData(UInt8 dest[], size_t destSize, UInt8 *srcData[], size_t *srcSize) {
if (srcData) {
if (*srcData) {
if (*srcSize < destSize) {
IOLogError("%s Attention size smaller than expected", getName());
return false;
Expand Down

0 comments on commit afa2840

Please sign in to comment.