bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/28250] New: Null pointer dereference in objdump (debug.c -


From: michalkniec91 at gmail dot com
Subject: [Bug binutils/28250] New: Null pointer dereference in objdump (debug.c -> debug_class_type_samep)
Date: Thu, 19 Aug 2021 17:20:58 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28250

            Bug ID: 28250
           Summary: Null pointer dereference in objdump (debug.c ->
                    debug_class_type_samep)
           Product: binutils
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: michalkniec91 at gmail dot com
  Target Milestone: ---

Function debug_class_type_samep is used for checking class debug info equality.
At line 3337, it should compare method variants, so in my opinion, it should
check for != NULL and only then compare method variants.

Now it checks for NULL so for classes with methods that have variants, it will
incorrectly return TRUE that they are equal (even if their method variants
differ). This produces incorrect output, for example when dumping stabs debug
info to a file.

What's more - in case where there are no method variants (don't know if that's
possible out in the wild), for-loop condition will dereference that NULL
pointer and cause a crash.

Snippet:

if (m1->variants == NULL)
            {
              struct debug_method_variant_s **pv1, **pv2;

              for (pv1 = m1->variants, pv2 = m2->variants;
                   *pv1 != NULL && *pv2 != NULL;
                   ++pv1, ++pv2)
                {

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]