Created attachment 164240 [details] check malloc result Hello all, We are trying to allocate buffer for MBR in the read_mbr() function by the call of the malloc(). But it may return NULL in error case. This patch adds check for this case.
A commit references this bug: Author: jhb Date: Thu Dec 17 20:42:06 UTC 2015 New revision: 292410 URL: https://svnweb.freebsd.org/changeset/base/292410 Log: Exit cleanly if malloc() fails to allocate a buffer for a copy of the current MBR. PR: 205322 Submitted by: Alexander Kuleshov <kuleshovmail@gmail.com> MFC after: 1 week Changes: head/usr.sbin/boot0cfg/boot0cfg.c
A commit references this bug: Author: jhb Date: Tue Jan 19 19:04:57 UTC 2016 New revision: 294338 URL: https://svnweb.freebsd.org/changeset/base/294338 Log: MFC 292410,292443,293977: Exit cleanly if malloc() fails to allocate a buffer for a copy of the current MBR. PR: 205322 Submitted by: Alexander Kuleshov <kuleshovmail@gmail.com> Changes: _U stable/10/ stable/10/usr.sbin/boot0cfg/boot0cfg.c _U stable/9/usr.sbin/boot0cfg/ stable/9/usr.sbin/boot0cfg/boot0cfg.c