gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gold / attributes.cc
index 2024fda62966168e744d164ac1672e482c3f7cf0..d31aac306be00225a5eedfda7bb4cd8e7520ec7b 100644 (file)
@@ -1,6 +1,6 @@
 // attributes.cc -- object attributes for gold
 
-// Copyright 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2020 Free Software Foundation, Inc.
 // Written by Doug Kwan <dougkwan@google.com>.
 // This file contains code adapted from BFD.
 
@@ -276,9 +276,9 @@ Attributes_section_data::Attributes_section_data(
     this->vendor_object_attributes_[vendor] =
       new Vendor_object_attributes(vendor);
 
-  const unsigned char *p = view;
+  const unsigned charp = view;
   p = view;
-  if (*(p++) == 'A')
+  if (size > 0 && p != NULL && *(p++) == 'A')
     {
       size--;
       while (size > 0)
@@ -296,7 +296,7 @@ Attributes_section_data::Attributes_section_data(
          section_size -= section_name_size + 4;
 
          int vendor;
-         const char *std_section = parameters->target().attributes_vendor();
+         const charstd_section = parameters->target().attributes_vendor();
          if (std_section != NULL && strcmp(section_name, std_section) == 0)
            vendor = Object_attribute::OBJ_ATTR_PROC;
          else if (strcmp(section_name, "gnu") == 0)
This page took 0.025925 seconds and 4 git commands to generate.