patch-ac 702 B

1234567891011121314151617181920212223
  1. $NetBSD: patch-ac,v 1.3 2005/03/21 15:19:28 salo Exp $
  2. --- faces.c.orig 2005-02-28 01:42:39.000000000 +0100
  3. +++ faces.c 2005-03-21 16:08:17.000000000 +0100
  4. @@ -54,9 +54,15 @@
  5. if (! strcmp(buf, "\n"))
  6. break;
  7. if (!strncmp(buf, "FirstName:", 10))
  8. - strcpy(fname, buf + 11);
  9. + {
  10. + strncpy(fname, buf + 11, BUFSIZ - 1);
  11. + fname[BUFSIZ - 1] = '\0';
  12. + }
  13. else if (!strncmp(buf, "LastName:", 9))
  14. - strcpy(lname, buf + 10);
  15. + {
  16. + strncpy(lname, buf + 10, BUFSIZ - 1);
  17. + lname[BUFSIZ - 1] = '\0';
  18. + }
  19. else if (!strncmp(buf, "Image:", 6)) {
  20. if (sscanf(buf + 7, "%d%d%d", &iw, &ih, &id) != 3) {
  21. fprintf(stderr,"facesLoad: %s - Bad image\n", name);