1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

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@
This commit is contained in:
schwarze 2019-03-03 16:07:39 +00:00
parent db513ec173
commit ab81fd4bef

View File

@ -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");