Date: Fri, 29 Jan 2016 22:05:55 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 206749] Lack of checks on values in ELF headers in kernel linker Message-ID: <bug-206749-8-jRULIV1Mem@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-206749-8@https.bugs.freebsd.org/bugzilla/> References: <bug-206749-8@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206749 --- Comment #1 from CTurt <cturt@hardenedbsd.org> --- Actually, since `M_WAITOK` is specified for the allocations, the current thread would theoretically sleep forever, whilst waiting for enough memory for the allocation. >From the man page (https://www.freebsd.org/cgi/man.cgi?query=malloc&sektion=9): "The malloc(), realloc(), and reallocf() functions cannot return NULL if M_WAITOK is specified." So the check for this allocation being NULL is not needed: if ((shdr = malloc(nbytes, M_LINKER, M_WAITOK)) == NULL) { error = ENOMEM; goto out; } -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206749-8-jRULIV1Mem>
