CVE-2020-27545: Release of Invalid Pointer or Reference (CWE-763)
value: libdwarf before 20201017 has a one-byte out-of-bounds read because of an invalid pointer dereference via an invalid line table in a crafted object.
CWE description: The product attempts to return a memory resource to the system, but it calls the wrong release function or calls the appropriate release function incorrectly.
CVSS v3 base score: 6.5
Published: 2023-04-16T00:15Z
Repository: https://github.com/davea42/libdwarf-code
Language: C
Files changed: ChangeLog, configure, configure.ac, dwarfdump/ChangeLog, dwarfdump/dwarf_names.c, dwarfdump/dwarf_names.h, dwarfdump/dwarfdump-ta-ext-table.h, dwarfdump/dwarfdump-ta-table.h, dwarfdump/dwarfdump-tt-ext-table.h, dwarfdump/dwarfdump-tt-table.h, libdwarf/ChangeLog, libdwarf/dwarf_names.c, libdwarf/dwarf_names.h, libdwarf/dwarf_names_enum.h, libdwarf/dwarf_names_new.h, libdwarf/generated_libdwarf.h.in, libdwarf/libdwarf_version.h
Commit date: 2020-10-17 12:40:58 -0700
Commit message: modified:   configure
	modified:   configure.ac now version 20201017

updated version string libdwarf_version.h
and regenerated files that have the version
string.
	modified:   dwarfdump/dwarf_names.c
	modified:   dwarfdump/dwarf_names.h
	modified:   dwarfdump/dwarfdump-ta-ext-table.h
	modified:   dwarfdump/dwarfdump-ta-table.h
	modified:   dwarfdump/dwarfdump-tt-ext-table.h
	modified:   dwarfdump/dwarfdump-tt-table.h

	modified:   libdwarf/dwarf_names.c
	modified:   libdwarf/dwarf_names.h
	modified:   libdwarf/dwarf_names_enum.h
	modified:   libdwarf/dwarf_names_new.h
	modified:   libdwarf/generated_libdwarf.h.in
	modified:   libdwarf/libdwarf_version.h

Diff: diff --git a/ChangeLog b/ChangeLog
index e4622a20..b103d735 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
+2020-10-17  David Anderson
+    * configure.ac: Now version 20201017
+    * configure: Regenerated.
 2020-10-11  David Anderson
     * configure.ac: Now version 20201011
     * configure: Regenerated.
 2020-10-03  David Anderson
     * Makefile.in,aclocal.m4,ar-lib,compile,configure,depcomp:
diff --git a/configure b/configure
index 90f4a66e..49905b72 100755
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libdwarf 20201011.
+# Generated by GNU Autoconf 2.69 for libdwarf 20201017.
 #
 # Report bugs to <libdwarf-list -at- linuxmail -dot- org>.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -588,12 +588,12 @@ MFLAGS=
 MAKEFLAGS=
 
 # Identity of this package.
 PACKAGE_NAME='libdwarf'
 PACKAGE_TARNAME='libdwarf'
-PACKAGE_VERSION='20201011'
-PACKAGE_STRING='libdwarf 20201011'
+PACKAGE_VERSION='20201017'
+PACKAGE_STRING='libdwarf 20201017'
 PACKAGE_BUGREPORT='libdwarf-list -at- linuxmail -dot- org'
 PACKAGE_URL=''
 
 ac_unique_file="configure.ac"
 # Factoring default headers for most tests.
@@ -1360,11 +1360,11 @@ done
 #
 if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libdwarf 20201011 to adapt to many kinds of systems.
+\`configure' configures libdwarf 20201017 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 To assign environment variables (e.g., CC, CFLAGS...), specify them as
 VAR=VALUE.  See below for descriptions of some of the useful variables.
@@ -1431,11 +1431,11 @@ System types:
 _ACEOF
 fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libdwarf 20201011:";;
+     short | recursive ) echo "Configuration of libdwarf 20201017:";;
    esac
   cat <<\_ACEOF
 
 Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
@@ -1564,11 +1564,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 fi
 
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libdwarf configure 20201011
+libdwarf configure 20201017
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
@@ -2108,11 +2108,11 @@ $as_echo "$ac_res" >&6; }
 } # ac_fn_c_check_type
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libdwarf $as_me 20201011, which was
+It was created by libdwarf $as_me 20201017, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
@@ -4340,11 +4340,11 @@ if test -z "$CYGPATH_W"; then
 fi
 
 
 # Define the identity of the package.
  PACKAGE='libdwarf'
- VERSION='20201011'
+ VERSION='20201017'
 
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
 _ACEOF
@@ -19401,11 +19401,11 @@ test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libdwarf $as_me 20201011, which was
+This file was extended by libdwarf $as_me 20201017, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -19467,11 +19467,11 @@ Report bugs to <libdwarf-list -at- linuxmail -dot- org>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libdwarf config.status 20201011
+libdwarf config.status 20201017
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
diff --git a/configure.ac b/configure.ac
index 72bd4e31..bb88f44d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,11 +14,11 @@ m4_define([lt_cur], [m4_eval(v_maj + v_min)])
 m4_define([lt_rev], [v_mic])
 m4_define([lt_age], [v_min])
 
 ### Sets the release name. 
 ###m4_define([v_date], [m4_esyscmd_s([date "+%Y%m%d"])])
-m4_define([v_date], [20201011])])
+m4_define([v_date], [20201017])])
 
 AC_PREREQ([2.52])
 ### 2nd arg to AC_INIT is the version 'number'.
 AC_INIT([libdwarf], [v_date], [libdwarf-list -at- linuxmail -dot- org])
 AC_CONFIG_SRCDIR([configure.ac])
diff --git a/dwarfdump/ChangeLog b/dwarfdump/ChangeLog
index 3ae603f6..8fb0f61e 100644
--- a/dwarfdump/ChangeLog
+++ b/dwarfdump/ChangeLog
@@ -1,5 +1,10 @@
+2020-10-17: David Anderson
+    * dwarf_names.c,dwarf_names.h,dwarfdump-ta-ext-table.h,
+      dwarfdump-ta-table.h,dwarfdump-tt-ext-table.h,
+      dwarfdump-tt-table.h: Regenerated with latest
+      version string.
 2020-10-15: David Anderson
     * print_lines.c(print_line_context_record): Fixed the
       comments  about DWARF4 vs 5.
 2020-10-13: David Anderson
     * print_macro.c: Added the required check for 0
diff --git a/dwarfdump/dwarf_names.c b/dwarfdump/dwarf_names.c
index 15483d6f..5e982fdf 100644
--- a/dwarfdump/dwarf_names.c
+++ b/dwarfdump/dwarf_names.c
@@ -1,7 +1,7 @@
 /* Generated routines, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #include "dwarf.h"
 
diff --git a/dwarfdump/dwarf_names.h b/dwarfdump/dwarf_names.h
index 930da06d..ae819dfb 100644
--- a/dwarfdump/dwarf_names.h
+++ b/dwarfdump/dwarf_names.h
@@ -1,7 +1,7 @@
 /* Generated routines, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #ifndef DWARF_NAMES_H
 #define DWARF_NAMES_H
diff --git a/dwarfdump/dwarfdump-ta-ext-table.h b/dwarfdump/dwarfdump-ta-ext-table.h
index 84707ccb..e208f0c9 100644
--- a/dwarfdump/dwarfdump-ta-ext-table.h
+++ b/dwarfdump/dwarfdump-ta-ext-table.h
@@ -1,7 +1,7 @@
 /* Generated code, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 /* Common extensions */
 #define ATTR_TREE_EXT_ROW_COUNT 18
diff --git a/dwarfdump/dwarfdump-ta-table.h b/dwarfdump/dwarfdump-ta-table.h
index 9ea82e8d..d90c0965 100644
--- a/dwarfdump/dwarfdump-ta-table.h
+++ b/dwarfdump/dwarfdump-ta-table.h
@@ -1,7 +1,7 @@
 /* Generated code, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #ifndef HAVE_USAGE_TAG_ATTR
 #define HAVE_USAGE_TAG_ATTR 1
diff --git a/dwarfdump/dwarfdump-tt-ext-table.h b/dwarfdump/dwarfdump-tt-ext-table.h
index 7c439580..c507a40d 100644
--- a/dwarfdump/dwarfdump-tt-ext-table.h
+++ b/dwarfdump/dwarfdump-tt-ext-table.h
@@ -1,7 +1,7 @@
 /* Generated code, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #define TAG_TREE_EXT_COLUMN_COUNT 5
 
diff --git a/dwarfdump/dwarfdump-tt-table.h b/dwarfdump/dwarfdump-tt-table.h
index c6e66de0..2d94c866 100644
--- a/dwarfdump/dwarfdump-tt-table.h
+++ b/dwarfdump/dwarfdump-tt-table.h
@@ -1,7 +1,7 @@
 /* Generated code, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #ifndef HAVE_USAGE_TAG_ATTR
 #define HAVE_USAGE_TAG_ATTR 1
diff --git a/libdwarf/ChangeLog b/libdwarf/ChangeLog
index bc39291e..527183ec 100644
--- a/libdwarf/ChangeLog
+++ b/libdwarf/ChangeLog
@@ -1,5 +1,9 @@
+2020-10-17: David Anderson
+    * libdwarf_version.h: updated version string
+    * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h,
+      dwarf_names_new.h: regenerated with new version string.
 2020-10-15: David Anderson
     * dwarf_line.c:Set up the default registers correctly
       for DWARF5 as well as earlier versions.
     * dwarf_line.h: update a comment.
     * dwarf_line_table_reader_common.c: Using ptrdiff_t
diff --git a/libdwarf/dwarf_names.c b/libdwarf/dwarf_names.c
index 15483d6f..5e982fdf 100644
--- a/libdwarf/dwarf_names.c
+++ b/libdwarf/dwarf_names.c
@@ -1,7 +1,7 @@
 /* Generated routines, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #include "dwarf.h"
 
diff --git a/libdwarf/dwarf_names.h b/libdwarf/dwarf_names.h
index 930da06d..ae819dfb 100644
--- a/libdwarf/dwarf_names.h
+++ b/libdwarf/dwarf_names.h
@@ -1,7 +1,7 @@
 /* Generated routines, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #ifndef DWARF_NAMES_H
 #define DWARF_NAMES_H
diff --git a/libdwarf/dwarf_names_enum.h b/libdwarf/dwarf_names_enum.h
index 8feb26b7..e7658b9d 100644
--- a/libdwarf/dwarf_names_enum.h
+++ b/libdwarf/dwarf_names_enum.h
@@ -1,7 +1,7 @@
 /* Automatically generated, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 #ifndef __DWARF_NAMES_ENUM_H__
 #define __DWARF_NAMES_ENUM_H__
diff --git a/libdwarf/dwarf_names_new.h b/libdwarf/dwarf_names_new.h
index 3a1dbdeb..37d60b20 100644
--- a/libdwarf/dwarf_names_new.h
+++ b/libdwarf/dwarf_names_new.h
@@ -1,7 +1,7 @@
 /* Automatically generated, do not edit. */
-/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
+/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
 
 /* BEGIN FILE */
 
 /* define DWARF_PRINT_PREFIX before this
    point if you wish to.  */
diff --git a/libdwarf/generated_libdwarf.h.in b/libdwarf/generated_libdwarf.h.in
index 8fc4d31b..08f3042b 100644
--- a/libdwarf/generated_libdwarf.h.in
+++ b/libdwarf/generated_libdwarf.h.in
@@ -3318,11 +3318,12 @@ int dwarf_macro_context_head(Dwarf_Macro_Context /*head*/,
     Dwarf_Bool     * /*has_operands_table*/,
     Dwarf_Half     * /*opcode_count*/,
     Dwarf_Error    * /*error*/);
 
 /*  Returns data from the operands table
-    in the macro unit header. */
+    in the macro unit header. The last op has
+    0 as opcode_number,operand_count and operand_array */
 int dwarf_macro_operands_table(Dwarf_Macro_Context /*head*/,
     Dwarf_Half    /*index*/, /* 0 to opcode_count -1 */
     Dwarf_Half  * /*opcode_number*/,
     Dwarf_Half  * /*operand_count*/,
     const Dwarf_Small ** /*operand_array*/,
diff --git a/libdwarf/libdwarf_version.h b/libdwarf/libdwarf_version.h
index e09264d2..248edf3c 100644
--- a/libdwarf/libdwarf_version.h
+++ b/libdwarf/libdwarf_version.h
@@ -2,6 +2,6 @@
     This date string is hereby put into the public domain.
     Copyrighting this is crazy. It's just a date string
     and is modified from time to time.
 */
 
-#define DW_VERSION_DATE_STR " 2020-10-11 11:34:27-07:00  "
+#define DW_VERSION_DATE_STR " 2020-10-17 11:30:22-07:00  "

Vulnerable code: # Generated by GNU Autoconf 2.69 for libdwarf 20201011.
PACKAGE_VERSION='20201011'
PACKAGE_STRING='libdwarf 20201011'
\`configure' configures libdwarf 20201011 to adapt to many kinds of systems.
     short | recursive ) echo "Configuration of libdwarf 20201011:";;
libdwarf configure 20201011
It was created by libdwarf $as_me 20201011, which was
 VERSION='20201011'
This file was extended by libdwarf $as_me 20201011, which was
libdwarf config.status 20201011
m4_define([v_date], [20201011])])
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
/* Generated sourcedate  2020-10-11 11:34:27-07:00   */
    in the macro unit header. */
#define DW_VERSION_DATE_STR " 2020-10-11 11:34:27-07:00  "
Fixed code: 2020-10-17  David Anderson
    * configure.ac: Now version 20201017
    * configure: Regenerated.
# Generated by GNU Autoconf 2.69 for libdwarf 20201017.
PACKAGE_VERSION='20201017'
PACKAGE_STRING='libdwarf 20201017'
\`configure' configures libdwarf 20201017 to adapt to many kinds of systems.
     short | recursive ) echo "Configuration of libdwarf 20201017:";;
libdwarf configure 20201017
It was created by libdwarf $as_me 20201017, which was
 VERSION='20201017'
This file was extended by libdwarf $as_me 20201017, which was
libdwarf config.status 20201017
m4_define([v_date], [20201017])])
2020-10-17: David Anderson
    * dwarf_names.c,dwarf_names.h,dwarfdump-ta-ext-table.h,
      dwarfdump-ta-table.h,dwarfdump-tt-ext-table.h,
      dwarfdump-tt-table.h: Regenerated with latest
      version string.
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
2020-10-17: David Anderson
    * libdwarf_version.h: updated version string
    * dwarf_names.c,dwarf_names.h,dwarf_names_enum.h,
      dwarf_names_new.h: regenerated with new version string.
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
/* Generated sourcedate  2020-10-17 11:30:22-07:00   */
    in the macro unit header. The last op has
    0 as opcode_number,operand_count and operand_array */
#define DW_VERSION_DATE_STR " 2020-10-17 11:30:22-07:00  "