patch-libutils_string_lib_c 588 B

123456789101112131415
  1. $OpenBSD: patch-libutils_string_lib_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
  2. --- libutils/string_lib.c.orig Wed Jan 20 01:38:43 2016
  3. +++ libutils/string_lib.c Wed Jan 20 01:40:04 2016
  4. @@ -1023,8 +1023,8 @@ bool StringAppendAbbreviatedPromise(char *dst, const c
  5. last_line += tail - max_fragment;
  6. }
  7. memcpy(abbr, src, head);
  8. - strcpy(abbr + head, sep);
  9. - strcat(abbr, last_line);
  10. + strlcpy(abbr + head, sep, sizeof(abbr)-head );
  11. + strlcat(abbr, last_line, sizeof(abbr) );
  12. return StringAppendPromise(dst, abbr, n);
  13. }
  14. }