Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a few null checks for NewWithAvailableSize #3123

Merged
merged 3 commits into from
Oct 8, 2020

Conversation

andy31415
Copy link
Contributor

Problem

NewWithAvailableSize on Packet buffers may fail. We do not always check for this.

Summary of Changes

Added checks for various places (our security scans reported a few of these).

src/controller/java/CHIPDeviceController-JNI.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 8, 2020

Size increase report for "esp32-example-build"

File Section File VM
chip-wifi-echo.elf .flash.rodata 48 48
chip-wifi-echo.elf .flash.text 24 24
chip-wifi-echo.elf .dram0.bss 0 -8
chip-wifi-echo.elf .dram0.data -8 -8
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-wifi-echo.elf and ./pull_artifact/chip-wifi-echo.elf:

sections,vmsize,filesize
.debug_line,0,106
.flash.rodata,48,48
.debug_info,0,33
.flash.text,24,24
.debug_ranges,0,8
.dram0.bss,-8,0
.dram0.data,-8,-8
.debug_loc,0,-14
[Unmapped],0,-45


@BroderickCarlin BroderickCarlin merged commit 08bfcce into project-chip:master Oct 8, 2020
kpschoedel pushed a commit to kpschoedel/connectedhomeip that referenced this pull request Oct 9, 2020
* Added a few null checks for NewWithAvailableSize

* Fix typo

* Added scoped lock construct for jni
@andy31415 andy31415 deleted the 01_add_null_check branch October 9, 2020 18:25
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.

4 participants