Re: PR25993, read of freed memory
[deliverable/binutils-gdb.git] / bfd / hash.c
index 5b44d4f9f17f9e589dd8226af5b174c52dc6e2c5..56d18ac317945a8bdd2d17166cf32e7ec0c595bf 100644 (file)
@@ -1,5 +1,5 @@
 /* hash.c -- hash table routines for BFD
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2020 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -435,6 +435,7 @@ bfd_hash_hash (const char *string, unsigned int *lenp)
   unsigned int len;
   unsigned int c;
 
+  BFD_ASSERT (string != NULL);
   hash = 0;
   len = 0;
   s = (const unsigned char *) string;
@@ -761,7 +762,7 @@ struct bfd_strtab_hash *
 _bfd_stringtab_init (void)
 {
   struct bfd_strtab_hash *table;
-  bfd_size_type amt = sizeof (* table);
+  size_t amt = sizeof (* table);
 
   table = (struct bfd_strtab_hash *) bfd_malloc (amt);
   if (table == NULL)
This page took 0.025378 seconds and 4 git commands to generate.