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

Fix endpoint index lookups to handle invalid endpoint ids correctly. #22275

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

There are some code paths that loop over all endpoint indices (including ones
that do not have an endpoint defined yet) and then use the endpoint id to look
up endpoint indices. Make sure we don't claim an endpoint index for the "not an
endpoint" endpoint id.

Also fixes findClusterEndpointIndex to check for the invalid endpoint id before
working with it, since that means the endpoint index it's looking at does not
correspond to a defined endpoint.

Fixes #22272

Problem

Crashes due to trying to work with not-actually-defined endpoints.

Change overview

Make sure we don't do that.

Testing

@latch-danielkneip verified that this fixes #22272 for him.

There are some code paths that loop over all endpoint indices (including ones
that do not have an endpoint defined yet) and then use the endpoint id to look
up endpoint indices.  Make sure we don't claim an endpoint index for the "not an
endpoint" endpoint id.

Also fixes findClusterEndpointIndex to check for the invalid endpoint id before
working with it, since that means the endpoint index it's looking at does not
correspond to a defined endpoint.

Fixes project-chip#22272
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

PR #22275: Size comparison from 3be848d to ae67d58

Increases (38 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, nrfconnect, psoc6, telink)
platform target config section 3be848d ae67d58 change % change
bl602 lighting-app bl602 (read/write) 1385118 1385134 16 0.0
.text 1051520 1051536 16 0.0
bl602+rpc (read/write) 1431006 1431022 16 0.0
.text 1083532 1083548 16 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 673051 673067 16 0.0
.text 583900 583916 16 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637747 637763 16 0.0
.text 559444 559460 16 0.0
lock-ftd LP_CC2652R7 (read only) 674087 674103 16 0.0
.text 596936 596952 16 0.0
lock-mtd LP_CC2652R7 (read only) 657027 657043 16 0.0
.text 554664 554680 16 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586754 586770 16 0.0
.app_xip_area 463412 463428 16 0.0
lock cyw930739m2evb_01 (read/write) 592506 592522 16 0.0
.app_xip_area 464380 464396 16 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599498 599506 8 0.0
.app_xip_area 476876 476884 8 0.0
efr32 lighting-app BRD4161A (read/write) 1107616 1107632 16 0.0
.text 969192 969208 16 0.0
BRD4161A+rpc (read/write) 971636 971652 16 0.0
.text 818520 818536 16 0.0
BRD4161A+rs911x (read/write) 1001352 1001368 16 0.0
.text 830180 830196 16 0.0
lock-app BRD4161A+wf200 (read/write) 1149796 1149812 16 0.0
.text 995536 995552 16 0.0
esp32 all-clusters-app c3devkit (read only) 1033554 1033610 56 0.0
.flash.text 1033554 1033610 56 0.0
m5stack (read only) 1085891 1085911 20 0.0
.flash.text 1080507 1080527 20 0.0
k32w light k32w0+release (read/write) 647356 647372 16 0.0
.text 572136 572152 16 0.0
lock k32w0+release (read/write) 704352 704368 16 0.0
.text 628684 628700 16 0.0
linux all-clusters-app debug (read only) 3043833 3043897 64 0.0
.text 2589090 2589154 64 0.0
all-clusters-minimal-app debug (read only) 2879633 2879697 64 0.0
.text 2427506 2427570 64 0.0
bridge-app debug+rpc (read only) 2377897 2377977 80 0.0
.text 2010818 2010898 80 0.0
chip-tool debug (read only) 10909393 10909409 16 0.0
.text 8824340 8824356 16 0.0
chip-tool-ipv6only arm64 (read only) 10290068 10290100 32 0.0
.text 8142948 8142980 32 0.0
lighting-app debug+rpc (read only) 2602825 2602889 64 0.0
.text 2210626 2210690 64 0.0
lock-app debug (read only) 2585793 2585857 64 0.0
.text 2180850 2180914 64 0.0
ota-provider-app debug (read only) 2363049 2363113 64 0.0
.text 1989314 1989378 64 0.0
ota-requestor-app debug (read only) 2528377 2528441 64 0.0
.text 2138770 2138834 64 0.0
shell debug (read only) 2612137 2612201 64 0.0
.text 2218018 2218082 64 0.0
thermostat-no-ble arm64 (read only) 2361844 2361876 32 0.0
.text 1982528 1982560 32 0.0
tv-app debug (read only) 3188841 3188921 80 0.0
.text 2739026 2739106 80 0.0
tv-casting-app debug (read only) 5509393 5509457 64 0.0
.text 4892546 4892610 64 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180755 1180771 16 0.0
text 814792 814804 12 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159935 1159951 16 0.0
text 803184 803196 12 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read/write) 1741812 1741828 16 0.0
.debug_loc 3568779 3568836 57 0.0
.text 1542296 1542312 16 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read/write) 1684980 1685012 32 0.0
.debug_loc 3556416 3556473 57 0.0
.text 1486200 1486232 32 0.0
light cy8ckit_062s2_43012 (read/write) 1602284 1602300 16 0.0
.debug_loc 3254757 3254814 57 0.0
.text 1411736 1411752 16 0.0
lock cy8ckit_062s2_43012 (read/write) 1639956 1639988 32 0.0
.debug_loc 3294625 3294682 57 0.0
.text 1444376 1444408 32 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808664 808672 8 0.0
text 571264 571274 10 0.0
lighting-app tlsr9518adk80d (read/write) 830564 830588 24 0.0
text 589376 589398 22 0.0
Decreases (7 builds for cc13x2_26x2, psoc6)
platform target config section 3be848d ae67d58 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 178340 178324 -16 -0.0
lock-ftd LP_CC2652R7 (read/write) 167616 167600 -16 -0.0
lock-mtd LP_CC2652R7 (read/write) 180364 180348 -16 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_abbrev 1221363 1221345 -18 -0.0
.debug_info 26701650 26701649 -1 -0.0
all-clusters-minimal cy8ckit_062s2_43012 .debug_abbrev 1213202 1213184 -18 -0.0
light cy8ckit_062s2_43012 .debug_abbrev 1048021 1048003 -18 -0.0
.debug_info 21900555 21900554 -1 -0.0
lock cy8ckit_062s2_43012 .debug_abbrev 1055456 1055438 -18 -0.0
.debug_info 22280302 22280301 -1 -0.0
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
platform target config section 3be848d ae67d58 change % change
bl602 lighting-app bl602 (read/write) 1385118 1385134 16 0.0
.bss 120274 120274 0 0.0
.data 4488 4488 0 0.0
.text 1051520 1051536 16 0.0
bl602+rpc (read/write) 1431006 1431022 16 0.0
.bss 127706 127706 0 0.0
.data 4600 4600 0 0.0
.text 1083532 1083548 16 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 673051 673067 16 0.0
(read/write) 178340 178324 -16 -0.0
.bss 74284 74284 0 0.0
.data 3372 3372 0 0.0
.rodata 88835 88835 0 0.0
.text 583900 583916 16 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637747 637763 16 0.0
(read/write) 157844 157844 0 0.0
.bss 73556 73556 0 0.0
.data 3372 3372 0 0.0
.rodata 77979 77979 0 0.0
.text 559444 559460 16 0.0
lock-ftd LP_CC2652R7 (read only) 674087 674103 16 0.0
(read/write) 167616 167600 -16 -0.0
.bss 71484 71484 0 0.0
.data 3296 3296 0 0.0
.rodata 76671 76671 0 0.0
.text 596936 596952 16 0.0
lock-mtd LP_CC2652R7 (read only) 657027 657043 16 0.0
(read/write) 180364 180348 -16 -0.0
.bss 67172 67172 0 0.0
.data 3296 3296 0 0.0
.rodata 101883 101883 0 0.0
.text 554664 554680 16 0.0
pump-app LP_CC2652R7 (read only) 684811 684811 0 0.0
(read/write) 157596 157596 0 0.0
.bss 71420 71420 0 0.0
.data 3296 3296 0 0.0
.rodata 89947 89947 0 0.0
.text 594380 594380 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669311 669311 0 0.0
(read/write) 173208 173208 0 0.0
.bss 71532 71532 0 0.0
.data 3292 3292 0 0.0
.rodata 85503 85503 0 0.0
.text 583328 583328 0 0.0
shell LP_CC2652R7 (read only) 665758 665758 0 0.0
(read/write) 181152 181152 0 0.0
.bss 76604 76604 0 0.0
.data 3376 3376 0 0.0
.rodata 85782 85782 0 0.0
.text 579660 579660 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586754 586770 16 0.0
.app_xip_area 463412 463428 16 0.0
.bss 65776 65776 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592506 592522 16 0.0
.app_xip_area 464380 464396 16 0.0
.bss 70560 70560 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599498 599506 8 0.0
.app_xip_area 476876 476884 8 0.0
.bss 65088 65088 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1107616 1107632 16 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 969192 969208 16 0.0
BRD4161A+rpc (read/write) 971636 971652 16 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 818520 818536 16 0.0
BRD4161A+rs911x (read/write) 1001352 1001368 16 0.0
.bss 169088 169088 0 0.0
.data 2064 2064 0 0.0
.text 830180 830196 16 0.0
lock-app BRD4161A+wf200 (read/write) 1149796 1149812 16 0.0
.bss 152168 152168 0 0.0
.data 2072 2072 0 0.0
.text 995536 995552 16 0.0
window-app BRD4161A (read/write) 1098872 1098872 0 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 958984 958984 0 0.0
esp32 all-clusters-app c3devkit (read only) 1033554 1033610 56 0.0
(read/write) 1493486 1493486 0 0.0
.dram0.bss 71088 71088 0 0.0
.dram0.data 13696 13696 0 0.0
.flash.rodata 218032 218032 0 0.0
.flash.text 1033554 1033610 56 0.0
.iram0.text 65160 65160 0 0.0
m5stack (read only) 1085891 1085911 20 0.0
(read/write) 490772 490772 0 0.0
.dram0.bss 76608 76608 0 0.0
.dram0.data 34152 34152 0 0.0
.flash.rodata 247344 247344 0 0.0
.flash.text 1080507 1080527 20 0.0
.iram0.text 123939 123939 0 0.0
k32w light k32w0+release (read/write) 647356 647372 16 0.0
.bss 70424 70424 0 0.0
.data 2068 2068 0 0.0
.text 572136 572152 16 0.0
lock k32w0+release (read/write) 704352 704368 16 0.0
.bss 70864 70864 0 0.0
.data 2076 2076 0 0.0
.text 628684 628700 16 0.0
linux all-clusters-app debug (read only) 3043833 3043897 64 0.0
(read/write) 156032 156032 0 0.0
.bss 61792 61792 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85768 85768 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1176 1176 0 0.0
.rodata 275307 275307 0 0.0
.text 2589090 2589154 64 0.0
all-clusters-minimal-app debug (read only) 2879633 2879697 64 0.0
(read/write) 147632 147632 0 0.0
.bss 61024 61024 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78264 78264 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 275467 275467 0 0.0
.text 2427506 2427570 64 0.0
bridge-app debug+rpc (read only) 2377897 2377977 80 0.0
(read/write) 127752 127752 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67640 67640 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 832 832 0 0.0
.rodata 204168 204168 0 0.0
.text 2010818 2010898 80 0.0
chip-tool debug (read only) 10909393 10909409 16 0.0
(read/write) 657384 657384 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 622352 622352 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 564213 564213 0 0.0
.text 8824340 8824356 16 0.0
chip-tool-ipv6only arm64 (read only) 10290068 10290100 32 0.0
(read/write) 705233 705233 0 0.0
.bss 33297 33297 0 0.0
.data 3280 3280 0 0.0
.data.rel.ro 649832 649832 0 0.0
.dynamic 560 560 0 0.0
.got 13848 13848 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 494660 494660 0 0.0
.text 8142948 8142980 32 0.0
lighting-app debug+rpc (read only) 2602825 2602889 64 0.0
(read/write) 130536 130536 0 0.0
.bss 49792 49792 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72680 72680 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221008 221008 0 0.0
.text 2210626 2210690 64 0.0
lock-app debug (read only) 2585793 2585857 64 0.0
(read/write) 125712 125712 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69688 69688 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 238000 238000 0 0.0
.text 2180850 2180914 64 0.0
ota-provider-app debug (read only) 2363049 2363113 64 0.0
(read/write) 119144 119144 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63512 63512 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 209976 209976 0 0.0
.text 1989314 1989378 64 0.0
ota-requestor-app debug (read only) 2528377 2528441 64 0.0
(read/write) 127552 127552 0 0.0
.bss 50368 50368 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68920 68920 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 856 856 0 0.0
.rodata 216704 216704 0 0.0
.text 2138770 2138834 64 0.0
shell debug (read only) 2612137 2612201 64 0.0
(read/write) 142184 142184 0 0.0
.bss 57704 57704 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77376 77376 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 235410 235410 0 0.0
.text 2218018 2218082 64 0.0
thermostat-no-ble arm64 (read only) 2361844 2361876 32 0.0
(read/write) 141857 141857 0 0.0
.bss 55233 55233 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 76112 76112 0 0.0
.dynamic 560 560 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 416 416 0 0.0
.rodata 141276 141276 0 0.0
.text 1982528 1982560 32 0.0
tv-app debug (read only) 3188841 3188921 80 0.0
(read/write) 258040 258040 0 0.0
.bss 167352 167352 0 0.0
.data 4752 4752 0 0.0
.data.rel.ro 79368 79368 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1080 1080 0 0.0
.rodata 259784 259784 0 0.0
.text 2739026 2739106 80 0.0
tv-casting-app debug (read only) 5509393 5509457 64 0.0
(read/write) 160536 160536 0 0.0
.bss 51352 51352 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 100304 100304 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1048 1048 0 0.0
.rodata 344945 344945 0 0.0
.text 4892546 4892610 64 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454936 2454936 0 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417580 1417580 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180755 1180771 16 0.0
bss 143641 143641 0 0.0
rodata 143380 143380 0 0.0
text 814792 814804 12 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159935 1159951 16 0.0
bss 142868 142868 0 0.0
rodata 134968 134968 0 0.0
text 803184 803196 12 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 842216 842216 0 0.0
(read/write) 1741812 1741828 16 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188464 188464 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1221363 1221345 -18 -0.0
.debug_aranges 111704 111704 0 0.0
.debug_frame 372868 372868 0 0.0
.debug_info 26701650 26701649 -1 -0.0
.debug_line 3655208 3655208 0 0.0
.debug_loc 3568779 3568836 57 0.0
.debug_ranges 337568 337568 0 0.0
.debug_str 3426748 3426748 0 0.0
.heap 842216 842216 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 570503 570503 0 0.0
.symtab 421456 421456 0 0.0
.text 1542296 1542312 16 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842952 842952 0 0.0
(read/write) 1684980 1685012 32 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187728 187728 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1213202 1213184 -18 -0.0
.debug_aranges 111176 111176 0 0.0
.debug_frame 375948 375948 0 0.0
.debug_info 26438272 26438272 0 0.0
.debug_line 3675724 3675724 0 0.0
.debug_loc 3556416 3556473 57 0.0
.debug_ranges 336184 336184 0 0.0
.debug_str 3415753 3415753 0 0.0
.heap 842952 842952 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 534977 534977 0 0.0
.symtab 408048 408048 0 0.0
.text 1486200 1486232 32 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 851184 851184 0 0.0
(read/write) 1602284 1602300 16 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179704 179704 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1048021 1048003 -18 -0.0
.debug_aranges 103352 103352 0 0.0
.debug_frame 346216 346216 0 0.0
.debug_info 21900555 21900554 -1 -0.0
.debug_line 3246189 3246189 0 0.0
.debug_loc 3254757 3254814 57 0.0
.debug_ranges 301656 301656 0 0.0
.debug_str 3220973 3220973 0 0.0
.heap 851184 851184 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 468276 468276 0 0.0
.symtab 375136 375136 0 0.0
.text 1411736 1411752 16 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 846152 846152 0 0.0
(read/write) 1639956 1639988 32 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184720 184720 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1055456 1055438 -18 -0.0
.debug_aranges 104024 104024 0 0.0
.debug_frame 349044 349044 0 0.0
.debug_info 22280302 22280301 -1 -0.0
.debug_line 3255010 3255010 0 0.0
.debug_loc 3294625 3294682 57 0.0
.debug_ranges 305000 305000 0 0.0
.debug_str 3248394 3248394 0 0.0
.heap 846152 846152 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 474491 474491 0 0.0
.symtab 378320 378320 0 0.0
.text 1444376 1444408 32 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808664 808672 8 0.0
bss 71344 71344 0 0.0
noinit 43488 43488 0 0.0
text 571264 571274 10 0.0
lighting-app tlsr9518adk80d (read/write) 830564 830588 24 0.0
bss 72200 72200 0 0.0
noinit 43488 43488 0 0.0
text 589376 589398 22 0.0

@andy31415
Copy link
Contributor

Patch accepted for 1.0: segfault fix (linked to an issue marked as patches acceptable)

@bzbarsky-apple bzbarsky-apple merged commit ec4ee00 into project-chip:master Aug 31, 2022
@bzbarsky-apple bzbarsky-apple deleted the fix-endpoint-lookup branch August 31, 2022 23:58
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
…roject-chip#22275)

There are some code paths that loop over all endpoint indices (including ones
that do not have an endpoint defined yet) and then use the endpoint id to look
up endpoint indices.  Make sure we don't claim an endpoint index for the "not an
endpoint" endpoint id.

Also fixes findClusterEndpointIndex to check for the invalid endpoint id before
working with it, since that means the endpoint index it's looking at does not
correspond to a defined endpoint.

Fixes project-chip#22272
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.

Seg fault in src/app/util/attribute-storage.cpp
4 participants