diff options
author | deraadt <deraadt@openbsd.org> | 2014-10-08 04:48:22 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2014-10-08 04:48:22 +0000 |
commit | 9ddacf26b74f2c6e3659818bd75b9e8d30493484 (patch) | |
tree | e94c1315652a4c3bab97857e77272af807b0d569 /usr.sbin/rdate | |
parent | obvious reallocarray() use for * int overflow; ok doug (diff) | |
download | wireguard-openbsd-9ddacf26b74f2c6e3659818bd75b9e8d30493484.tar.xz wireguard-openbsd-9ddacf26b74f2c6e3659818bd75b9e8d30493484.zip |
use reallocarray(). BTW << 3 is a sloppy compared to * sizeof(u_int64_t)...
ok doug
Diffstat (limited to 'usr.sbin/rdate')
-rw-r--r-- | usr.sbin/rdate/ntpleaps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rdate/ntpleaps.c b/usr.sbin/rdate/ntpleaps.c index 10db06e9abc..8c9323e5d23 100644 --- a/usr.sbin/rdate/ntpleaps.c +++ b/usr.sbin/rdate/ntpleaps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpleaps.c,v 1.12 2014/04/13 05:38:45 jsg Exp $ */ +/* $OpenBSD: ntpleaps.c,v 1.13 2014/10/08 04:48:22 deraadt Exp $ */ /* * Copyright (c) 2002 Thorsten Glaser. All rights reserved. @@ -152,7 +152,7 @@ ntpleaps_read(void) close(fd); return (-1); } - if ((l = (u_int64_t *)malloc(r << 3)) == NULL) { + if ((l = reallocarray(NULL, r, sizeof(u_int64_t))) == NULL) { close(fd); return (-1); } |