From 28add8fe6134a21f3824a9540dccb6d686052f13 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Thu, 18 Mar 1999 11:00:48 +0000 Subject: [PATCH] Don't choke in MOD_ARGS() if mp->m_args is NULL. --- sys/boot/alpha/libalpha/bootinfo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/boot/alpha/libalpha/bootinfo.c b/sys/boot/alpha/libalpha/bootinfo.c index e4644140f208..6062320bc22e 100644 --- a/sys/boot/alpha/libalpha/bootinfo.c +++ b/sys/boot/alpha/libalpha/bootinfo.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootinfo.c,v 1.3 1998/10/15 21:55:58 dfr Exp $ + * $Id: bootinfo.c,v 1.4 1999/03/08 11:05:42 dcs Exp $ */ #include @@ -88,10 +88,11 @@ bi_copyenv(vm_offset_t addr) } #define MOD_STR(t, a, s) { \ + const char *p = s ? s : ""; \ COPY32(t, a); \ - COPY32(strlen(s) + 1, a); \ - alpha_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(u_int64_t));\ + COPY32(strlen(p) + 1, a); \ + alpha_copyin(p, a, strlen(p) + 1); \ + a += roundup(strlen(p) + 1, sizeof(u_int64_t));\ } #define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s)