$OpenBSD: patch-libcharset_lib_localcharset_c,v 1.4 2010/05/28 09:20:40 espie Exp $
--- libcharset/lib/localcharset.c.orig	Sun Jan 25 20:04:42 2009
+++ libcharset/lib/localcharset.c	Wed May 12 15:32:44 2010
@@ -200,8 +200,9 @@ get_charset_aliases (void)
 		    free (old_res_ptr);
 		  break;
 		}
-	      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
-	      strcpy (res_ptr + res_size - (l2 + 1), buf2);
+	      strlcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1,
+		l1 + 1 + l2 + 1 + 1);
+	      strlcpy (res_ptr + res_size - (l2 + 1), buf2, l2 + 1 + 1);
 	    }
 	  fclose (fp);
 	  if (res_size == 0)
@@ -319,6 +320,8 @@ get_charset_aliases (void)
    If the canonical name cannot be determined, the result is a non-canonical
    name.  */
 
+const char *
+locale_charset (void) __attribute__((visibility ("default")));
 #ifdef STATIC
 STATIC
 #endif
