From a5c3ba3e65629b0354c94099f6dedf12b3d5a7fd Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 11 Jul 2017 21:19:42 +0000 Subject: [PATCH] Allocate enough memory. --- external/gpl3/binutils/usr.sbin/dbsym/dbsym.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c b/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c index 419bcd5e2a24..eacda47caec4 100644 --- a/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c +++ b/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c @@ -1,4 +1,4 @@ -/* $NetBSD: dbsym.c,v 1.5 2017/07/06 02:34:00 chs Exp $ */ +/* $NetBSD: dbsym.c,v 1.6 2017/07/11 21:19:42 joerg Exp $ */ /* * Copyright (c) 2001 Simon Burge (for Wasabi Systems) @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1996 Christopher G. Demetriou.\ Copyright 2001 Simon Burge.\ All rights reserved."); -__RCSID("$NetBSD: dbsym.c,v 1.5 2017/07/06 02:34:00 chs Exp $"); +__RCSID("$NetBSD: dbsym.c,v 1.6 2017/07/11 21:19:42 joerg Exp $"); #endif /* not lint */ #include @@ -426,7 +426,7 @@ load_symtab(bfd *abfd, int fd, char **symtab, u_int32_t *symtabsize) shstridx = (ISELF64 ? bfd_get_16(abfd, e64_hdr.e_shstrndx) : bfd_get_16(abfd, e32_hdr.e_shstrndx)); - shstrtab = malloc(shstridx); + shstrtab = malloc(SH_SIZE(shstridx)); if (shstrtab == NULL) goto out; if (pread(fd, shstrtab, SH_SIZE(shstridx), SH_OFFSET(shstridx)) !=