https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78944

            Bug ID: 78944
           Summary: null pointer in demangler
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: demangler
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com
  Target Milestone: ---

Demangling the name _Z3fooAv32pM causes null pointer dereferencing:

$ valgrind c++filt _Z3fooAv32pM
==11277== Memcheck, a memory error detector
==11277== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==11277== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==11277== Command: c++filt _Z3fooAv32pM
==11277== 
==11277== Invalid read of size 1
==11277==    at 0x4F140D9: d_expression_1 (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F13091: cplus_demangle_type (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F13387: d_parmlist (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F137FF: d_bare_function_type (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F14E80: d_encoding (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F1534B: cplus_demangle_mangled_name (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F1597A: d_demangle_callback (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F15AE8: d_demangle (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F15C3D: cplus_demangle_v3 (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x4F07153: cplus_demangle (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/lib/libbfd-2.26.20160125.so)
==11277==    by 0x402293: demangle_it (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/bin/c++filt)
==11277==    by 0x401F2C: main (in
/nix/store/bxzwd8nb1jjdh9fcqpii4x7r4gl2s8qb-binutils-2.26/bin/c++filt)
==11277==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Reply via email to