diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-31 20:47:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-31 20:47:40 +0000 |
commit | ef524d7a2fcc5dfaa8be32bc70c5398912d1a96d (patch) | |
tree | 9858ba73a21a3ff405a21311ee49bdbb65f2b7f7 /bin | |
parent | d3fb3dc5ccb8886e10d7a4fb7a145b4330b6ef02 (diff) |
clamp -ttttttttt test counter to 1B, so that it does not wrap negative;
from Nicholas Marriott, ok otto
Diffstat (limited to 'bin')
-rw-r--r-- | bin/md5/md5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c index d3c9aa9a672..3e128819d0b 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.46 2007/04/14 23:04:10 grunk Exp $ */ +/* $OpenBSD: md5.c,v 1.47 2007/10/31 20:47:39 deraadt Exp $ */ /* * Copyright (c) 2001,2003,2005-2006 Todd C. Miller <Todd.Miller@courtesan.com> @@ -678,7 +678,7 @@ digest_time(struct hash_list *hl, int times) char digest[MAX_DIGEST_LEN + 1]; double elapsed; int count = TEST_BLOCK_COUNT; - while (--times > 0) + while (--times > 0 && count < INT_MAX / 10) count *= 10; TAILQ_FOREACH(hf, hl, tailq) { |