# HG changeset patch # User Markus Bröker # Date 1287946519 -7200 # Node ID 8a5cf98a00b66db69099e8d4ff7ce0b63082fa36 # Parent f9015072361f2f1c4bafb4ebfaab2f4fc68b9b50 safer strcpy committer: Markus Bröker diff --git a/md5.c b/md5.c --- a/md5.c +++ b/md5.c @@ -29,8 +29,8 @@ /* * MD5 alters the input buffer */ - strcpy (buffer, argv[1]); - strcpy (text, argv[1]); + strncpy (buffer, argv[1], sizeof (buffer)); + strncpy (text, argv[1], sizeof (buffer)); md5_hash = MD5 ((u_char *) buffer, strlen (buffer), NULL);