]> git.ipfire.org Git - thirdparty/elfutils.git/commit
dwarf_getsrclines.c: Restore initialization of debug_str_offset
authorAaron Merey <amerey@redhat.com>
Thu, 14 May 2026 21:12:59 +0000 (17:12 -0400)
committerAaron Merey <amerey@redhat.com>
Thu, 14 May 2026 22:04:25 +0000 (18:04 -0400)
commite9fe6b1e2c73c78665537460400dd6385877daff
treec06f9bed5cd5ff5b19c48e48e27bfa55e79c3462
parent14d3cbf11cc07ddd56e7371e83ee1bcdda9a988b
dwarf_getsrclines.c: Restore initialization of debug_str_offset

Prior to commit d4b0848b ("libdw: dwarf_getsrcfiles should not imply
dwarf_getsrclines") debug_str_offset was initialized with a default
value of 0.  This default initialization was removed as part of the
refactor introduced in d4b0848b.

Restore debug_str_offset's default initialization to 0.  For a
well-formed binary, it wasn't possible to use debug_str_offset
uninitialized.  The value is only relevant for line headers using
NVIDIA's CUBIN extension, in which case the real offset was always
stored in debug_str_offset before use.  However it's possible for a
malformed binary to cause uninitialized use and static analyzers
may complain about this.

Signed-off-by: Aaron Merey <amerey@redhat.com>
libdw/dwarf_getsrclines.c