Skip to content
Permalink
Browse files

Avoid OOB read (found by ASAN reported by F. Alonso)

  • Loading branch information...
zoulasc committed Jan 2, 2019
1 parent 580927e commit 2858eaf99f6cc5aae129bcbf1e24ad160240185f
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/readelf.c
@@ -27,7 +27,7 @@
#include "file.h"

#ifndef lint
FILE_RCSID("@(#)$File: readelf.c,v 1.156 2018/10/19 00:33:04 christos Exp $")
FILE_RCSID("@(#)$File: readelf.c,v 1.157 2019/01/02 19:44:14 christos Exp $")
#endif

#ifdef BUILTIN_ELF
@@ -752,7 +752,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
char sbuf[512];
struct NetBSD_elfcore_procinfo pi;
memset(&pi, 0, sizeof(pi));
memcpy(&pi, nbuf + doff, descsz);
memcpy(&pi, nbuf + doff, MIN(descsz, sizeof(pi)));

if (file_printf(ms, ", from '%.31s', pid=%u, uid=%u, "
"gid=%u, nlwps=%u, lwp=%u (signal %u/code %u)",

0 comments on commit 2858eaf

Please sign in to comment.
You can’t perform that action at this time.