diff options
author | 2020-07-13 00:05:39 +0000 | |
---|---|---|
committer | 2020-07-13 00:05:39 +0000 | |
commit | 45cb88f9a3a12d75a71a395b18588edba080322c (patch) | |
tree | 8de9f145e5a17b7d250e45a89671f529a7133332 /sys/dev/softraid.c | |
parent | Remove comma that shouldn't be there. (diff) | |
download | wireguard-openbsd-45cb88f9a3a12d75a71a395b18588edba080322c.tar.xz wireguard-openbsd-45cb88f9a3a12d75a71a395b18588edba080322c.zip |
Fix malloc(9) size
Spotted while reading the code, we overallocate quite a bit:
(gdb) p sizeof(struct sr_meta_crypto) - sizeof(struct sr_meta_boot)
$1 = 2312
OK jsing
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index a9d62014199..3815cca7e58 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.406 2020/07/11 13:34:05 krw Exp $ */ +/* $OpenBSD: softraid.c,v 1.407 2020/07/13 00:05:39 kn Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -3736,7 +3736,7 @@ sr_ioctl_installboot(struct sr_softc *sc, struct sr_discipline *sd, if (omi == NULL) { omi = malloc(sizeof(struct sr_meta_opt_item), M_DEVBUF, M_WAITOK | M_ZERO); - omi->omi_som = malloc(sizeof(struct sr_meta_crypto), M_DEVBUF, + omi->omi_som = malloc(sizeof(struct sr_meta_boot), M_DEVBUF, M_WAITOK | M_ZERO); omi->omi_som->som_type = SR_OPT_BOOT; omi->omi_som->som_length = sizeof(struct sr_meta_boot); |