md5.c
changeset 162 fad55be2d07c
parent 148 8a5cf98a00b6
--- a/md5.c
+++ b/md5.c
@@ -29,8 +29,8 @@
     /*
      * MD5 alters the input buffer
      */
-    strncpy (buffer, argv[1], sizeof (buffer));
-    strncpy (text, argv[1], sizeof (buffer));
+    strncpy (buffer, argv[1], sizeof (buffer) - 1);
+    strncpy (text, argv[1], sizeof (text) - 1);
 
     md5_hash = MD5 ((u_char *) buffer, strlen (buffer), NULL);