RobustFieldAutonomyLab / LeGO-LOAM

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain
BSD 3-Clause "New" or "Revised" License
2.4k stars 1.12k forks source link

Critical bug in featureAssociation.cpp #116

Closed facontidavide closed 5 years ago

facontidavide commented 5 years ago

Compiling the application using the address sanitizer, we notice a buffer overflow here

==23413==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6340000407fc at pc 0x00000041d8ed bp 0x7ffccffcccb0 sp 0x7ffccffccca0
READ of size 4 at 0x6340000407fc thread T0
    #0 0x41d8ec in FeatureAssociation::extractFeatures() /home/df/ws_temp/src/LeGO-LOAM/LeGO-LOAM/src/featureAssociation.cpp:749
    #1 0x41d8ec in FeatureAssociation::runFeatureAssociation() /home/df/ws_temp/src/LeGO-LOAM/LeGO-LOAM/src/featureAssociation.cpp:1826
    #2 0x41d8ec in main /home/df/ws_temp/src/LeGO-LOAM/LeGO-LOAM/src/featureAssociation.cpp:1866
    #3 0x7fc5206cd82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #4 0x41e198 in _start (/home/df/ws_temp/devel/lib/lego_loam/featureAssociation+0x41e198)

To use the sanitizer change you CMakeLists.txtx as follows:

      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3  -g -fsanitize=address -fno-omit-frame-pointer")
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.