]> sourceware.org Git - systemtap.git/commit
translate.cxx: Fix out-of-bounds vector access
authorAaron Merey <amerey@redhat.com>
Tue, 23 Apr 2024 17:29:35 +0000 (13:29 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 23 Apr 2024 18:11:18 +0000 (14:11 -0400)
commitdaae62231a8aa82357c7877d28dfebff475a6059
treed2e5aa4dede700920e0330ae445a3fe6704de255
parent22e146b57ecf8a4d637d99d4558ae89c9a3c2617
translate.cxx: Fix out-of-bounds vector access

The following error was found by building stap with
-D_GLIBCXX_DEBUG and -D_GLIBCXX_DEBUG_PEDANTIC:

    /usr/include/c++/13/debug/vector:442:
    In function:
        std::debug::vector<_Tp, _Allocator>::reference std::debug::vector<_Tp,
        _Allocator>::operator[](size_type) [with _Tp = bool; _Allocator =
        std::allocator<bool>; reference = std::vector<bool, std::allocator<bool>
        >::reference; size_type = long unsigned int]

    Error: attempt to subscript container with out-of-bounds index 1, but
    container only holds 1 elements.

    Objects involved in the operation:
        sequence "this" @ 0x7fffffff8e70 {
          type = std::debug::vector<bool, std::allocator<bool> >;
        }

This is caused by an incorrectly sized vector in
c_unparser::visit_functioncall.  Fix this by ensuring that
the vector cp_args has a size equal to the number of arguments
of the functioncall being visited.
translate.cxx
This page took 0.027947 seconds and 5 git commands to generate.