patch-main_c 610 B

12345678910111213141516
  1. $OpenBSD: patch-main_c,v 1.2 2014/05/08 20:49:41 sthen Exp $
  2. Trivial change of strcpy() to strlcpy().
  3. Size of stack variable mcf and mcf2 is well known.
  4. `make check` runs fine with it.
  5. --- main.c.orig Tue May 6 11:42:07 2014
  6. +++ main.c Thu May 8 21:29:01 2014
  7. @@ -148,7 +148,7 @@ int main()
  8. printf("TEST EIGHT: SUCCESSFUL, calculated mcf\n%s\n", mcf);
  9. /* Since later calls to scrypt_check() butcher mcf, make a second */
  10. - strcpy(mcf2, mcf);
  11. + strlcpy(mcf2, mcf, SCRYPT_MCF_LEN);
  12. /* Couldn't be simpler - for a given mcf, check is the password is valid
  13. * Returns < 0 on failure to calculate hash