mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-07 05:35:07 -05:00
checks.c: fix heap-buffer-overflow
./dtc -I dts -O dtb -o aliases.dtb /home/elmarco/src/dtc/tests/aliases.dts
=================================================================
==882911==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000113 at pc 0x7f34ba0abf50 bp 0x7ffc8db22450 sp 0x7ffc8db21c00
READ of size 4 at 0x602000000113 thread T0
#0 0x7f34ba0abf4f in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) (/lib64/libasan.so.8+0xabf4f)
#1 0x7f34ba0ac5e8 in memcmp (/lib64/libasan.so.8+0xac5e8)
#2 0x4282dc in check_spi_bus_bridge ../checks.c:1110
#3 0x41b08d in check_nodes_props ../checks.c:140
#4 0x41b9c4 in run_check ../checks.c:180
#5 0x430a3b in process_checks ../checks.c:2056
#6 0x436a90 in main ../dtc.c:327
#7 0x7f34b964a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
#8 0x7f34b964a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
#9 0x4025c4 in _start (/home/elmarco/src/dtc/build/dtc+0x4025c4)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
44c9b73801
commit
ee57999386
1 changed files with 1 additions and 1 deletions
2
checks.c
2
checks.c
|
|
@ -1108,7 +1108,7 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct no
|
|||
for_each_child(node, child) {
|
||||
struct property *prop;
|
||||
for_each_property(child, prop) {
|
||||
if (strprefixeq(prop->name, 4, "spi-")) {
|
||||
if (strstarts(prop->name, "spi-")) {
|
||||
node->bus = &spi_bus;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue