diff options
-rw-r--r-- | lib/libc/stdlib/malloc.3 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 58afb65c5c3..35f83a0c24c 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -30,9 +30,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: malloc.3,v 1.46 2007/05/31 19:19:31 jmc Exp $ +.\" $OpenBSD: malloc.3,v 1.47 2007/08/08 21:24:29 millert Exp $ .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: August 8 2007 $ .Dt MALLOC 3 .Os .Sh NAME @@ -100,7 +100,7 @@ If .Fn malloc must be used, be sure to test for overflow: .Bd -literal -offset indent -if (num && SIZE_MAX / num < size) { +if (size && num > SIZE_MAX / size) { errno = ENOMEM; err(1, "overflow"); } |