diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2013-03-06 08:34:06 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2013-03-06 08:34:06 +0000 |
commit | 170df5c7089cc98a4cfa8aee9eb1441e66efd28e (patch) | |
tree | a97e952bf3db85fc967b555f178fa65d1643116b | |
parent | 0fe688e76e0dce2ae340de6539bccdc64a65d8f1 (diff) |
Fix a bad comparison when calculating the size of the hibernate signature
block
ok deraadt@
-rw-r--r-- | sys/kern/subr_hibernate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index a3007fe591e..476d4ef3fc7 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.50 2013/01/17 02:51:08 pirofti Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.51 2013/03/06 08:34:05 mlarkin Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -632,7 +632,7 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend) hiber_info->secsize = dl.d_secsize; /* Make sure the signature can fit in one block */ - KASSERT(sizeof(union hibernate_info)/hiber_info->secsize == 1); + KASSERT(sizeof(union hibernate_info) <= hiber_info->secsize); /* Calculate swap offset from start of disk */ hiber_info->swap_offset = dl.d_partitions[1].p_offset; |