]> andersk Git - openssh.git/blobdiff - deattack.c
- (tim) [configure.ac] updwtmpx() on OpenServer seems to add duplicate entry.
[openssh.git] / deattack.c
index 12849a32dc84f94ec110a4f8d3e49113ac44446e..8b55d668681a1e78c0c2973cedcace140a8b25d9 100644 (file)
@@ -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);
                }
        }
 
This page took 0.034037 seconds and 4 git commands to generate.