Don't access non-existing element buf[256], use buf[255] instead.
[openssl.git] / crypto / lhash / lh_test.c
index f90b3bbd24ae699104898ca302494baf0daa5f4b..0758d8837259843a2fd0bd6815eafe05f47f17da 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/lhash/lh_test.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
@@ -59,7 +59,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "lhash.h"
+#include <openssl/lhash.h>
 
 main()
        {
@@ -75,9 +75,9 @@ main()
                buf[0]='\0';
                fgets(buf,256,stdin);
                if (buf[0] == '\0') break;
-               buf[256]='\0';
+               buf[255]='\0';
                i=strlen(buf);
-               p=Malloc(i+1);
+               p=OPENSSL_malloc(i+1);
                memcpy(p,buf,i+1);
                lh_insert(conf,p);
                }