patch-libcharset_lib_localcharset_c 1.0 KB

12345678910111213141516171819202122232425
  1. $OpenBSD: patch-libcharset_lib_localcharset_c,v 1.5 2011/09/02 15:44:46 naddy Exp $
  2. --- libcharset/lib/localcharset.c.orig Thu Sep 1 18:15:01 2011
  3. +++ libcharset/lib/localcharset.c Thu Sep 1 18:17:12 2011
  4. @@ -232,8 +232,9 @@ get_charset_aliases (void)
  5. free (old_res_ptr);
  6. break;
  7. }
  8. - strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
  9. - strcpy (res_ptr + res_size - (l2 + 1), buf2);
  10. + strlcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1,
  11. + l1 + 1 + l2 + 1 + 1);
  12. + strlcpy (res_ptr + res_size - (l2 + 1), buf2, l2 + 1 + 1);
  13. }
  14. fclose (fp);
  15. if (res_size == 0)
  16. @@ -352,6 +353,8 @@ get_charset_aliases (void)
  17. If the canonical name cannot be determined, the result is a non-canonical
  18. name. */
  19. +const char *
  20. +locale_charset (void) __attribute__((visibility ("default")));
  21. #ifdef STATIC
  22. STATIC
  23. #endif