X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/184eed6a9e5b95e89c2fc77fd9b703a2c50781ee..34f2baf0f5d9dad08aaed92f16ee660b9c150d65:/deattack.c diff --git a/deattack.c b/deattack.c index 12849a32..8b55d668 100644 --- a/deattack.c +++ b/deattack.c @@ -1,5 +1,3 @@ -/* $OpenBSD: deattack.c,v 1.17 2001/12/19 07:18:56 deraadt Exp $ */ - /* * Cryptographic attack detector for ssh - source code * @@ -20,6 +18,8 @@ */ #include "includes.h" +RCSID("$OpenBSD: deattack.c,v 1.19 2003/09/18 08:49:45 markus Exp $"); + #include "deattack.h" #include "log.h" #include "crc32.h" @@ -100,12 +100,12 @@ detect_attack(u_char *buf, u_int32_t len, u_char *IV) if (h == NULL) { debug("Installing crc compensation attack detector."); + h = (u_int16_t *) xmalloc(l * HASH_ENTRYSIZE); n = l; - h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE); } else { if (l > n) { + h = (u_int16_t *) xrealloc(h, l * HASH_ENTRYSIZE); n = l; - h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE); } }