Skip to content

Conversation

@s-mcclain
Copy link
Contributor

Summary

Add additional checks inside ContentAppPlatform to first check if mContentAppFactory is null to prevent nullptr dereference crashes.

Related issues

[Problem]
There are several dereferences to mContentAppFactory without first checking if pointer is valid.

Add additional checks inside ContentAppPlatform to first check
if mContentAppFactory is null to prevent nullptr dereference crashes.

[Problem]
There are several dereferences to mContentAppFactory without first
checking if pointer is valid.
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds necessary nullptr checks for mContentAppFactory in several methods within ContentAppPlatform.cpp. These changes are crucial for preventing potential nullptr dereference crashes, thereby improving the robustness and stability of the application platform. The added checks are correctly implemented using the appropriate VerifyOrReturnValue and VerifyOrReturnError macros, ensuring that the functions fail gracefully if mContentAppFactory is not initialized. The changes are clear, correct, and effectively address the identified issue.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

PR #41827: Size comparison from bc6337d to 2588315

Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
platform target config section bc6337d 2588315 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1106340 1106340 0 0.0
RAM 178930 178930 0 0.0
bl702 lighting-app bl702+eth FLASH 661414 661414 0 0.0
RAM 135025 135025 0 0.0
bl702+wifi FLASH 837008 837008 0 0.0
RAM 124445 124445 0 0.0
bl706+mfd+rpc+littlefs FLASH 1070610 1070610 0 0.0
RAM 117317 117317 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 900042 900042 0 0.0
RAM 105612 105612 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 983356 983356 0 0.0
RAM 109796 109796 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 770820 770820 0 0.0
RAM 103360 103360 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 782664 782664 0 0.0
RAM 108528 108528 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 728612 728612 0 0.0
RAM 97420 97420 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 713080 713080 0 0.0
RAM 97636 97636 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 554906 554906 0 0.0
RAM 205776 205776 0 0.0
lock CC3235SF_LAUNCHXL FLASH 587786 587786 0 0.0
RAM 205872 205872 0 0.0
efr32 lock-app BRD4187C FLASH 963504 963504 0 0.0
RAM 123572 123572 0 0.0
BRD4338a FLASH 757752 757752 0 0.0
RAM 254196 254196 0 0.0
window-app BRD4187C FLASH 1058820 1058820 0 0.0
RAM 119800 119800 0 0.0
esp32 all-clusters-app c3devkit DRAM 102572 102572 0 0.0
FLASH 1836720 1836720 0 0.0
IRAM 93540 93540 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 933452 933452 0 0.0
RAM 161377 161377 0 0.0
nxp contact mcxw71+release FLASH 692504 692504 0 0.0
RAM 61552 61552 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1678092 1678092 0 0.0
RAM 213956 213956 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1594492 1594492 0 0.0
RAM 211156 211156 0 0.0
light cy8ckit_062s2_43012 FLASH 1460732 1460732 0 0.0
RAM 197776 197776 0 0.0
lock cy8ckit_062s2_43012 FLASH 1493420 1493420 0 0.0
RAM 225496 225496 0 0.0
qpg lighting-app qpg6200+debug FLASH 837768 837768 0 0.0
RAM 127768 127768 0 0.0
lock-app qpg6200+debug FLASH 774580 774580 0 0.0
RAM 118736 118736 0 0.0
realtek light-switch-app rtl8777g FLASH 706952 706952 0 0.0
RAM 106964 106964 0 0.0
lighting-app rtl8777g FLASH 757896 757896 0 0.0
RAM 127296 127296 0 0.0
stm32 light STM32WB5MM-DK FLASH 470224 470224 0 0.0
RAM 141352 141352 0 0.0
telink bridge-app tl7218x FLASH 710608 710608 0 0.0
RAM 90600 90600 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 797084 797084 0 0.0
RAM 41024 41024 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 788286 788286 0 0.0
RAM 93700 93700 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 715286 715286 0 0.0
RAM 51892 51892 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 748582 748582 0 0.0
RAM 70932 70932 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 725436 725436 0 0.0
RAM 34624 34624 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 602672 602672 0 0.0
RAM 108928 108928 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 820918 820922 4 0.0
RAM 92096 92096 0 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant