diff options
author | 2019-03-03 16:07:39 +0000 | |
---|---|---|
committer | 2019-03-03 16:07:39 +0000 | |
commit | ab81fd4befd2ee36f3f417cf2c4035006aeffcf2 (patch) | |
tree | d1c0dca3baef876b2fb2cca3f52a4e656496dfd1 | |
parent | portmap arrived decades after after DARPA addresses became known as (diff) | |
download | wireguard-openbsd-ab81fd4befd2ee36f3f417cf2c4035006aeffcf2.tar.xz wireguard-openbsd-ab81fd4befd2ee36f3f417cf2c4035006aeffcf2.zip |
on malloc(3) failure, gracefully abort processing of the current file
rather than crashing with a NULL pointer access;
patch from Benjamin Baier <programmer at netzbasis dot de>;
OK otto@ deraadt@
-rw-r--r-- | usr.bin/nm/nm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c index 86bf940ab8e..319273dd5e0 100644 --- a/usr.bin/nm/nm.c +++ b/usr.bin/nm/nm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nm.c,v 1.53 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: nm.c,v 1.54 2019/03/03 16:07:39 schwarze Exp $ */ /* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */ /* @@ -381,6 +381,7 @@ show_symtab(off_t off, u_long len, const char *name, FILE *fp) if ((p = malloc(sizeof(ar_head.ar_name))) == NULL) { warn("%s: malloc", name); MUNMAP(symtab, len); + return (1); } printf("\nArchive index:\n"); |