SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,24 @@
--- gettext-runtime/intl/log.c.orig Tue Dec 4 07:28:58 2012
+++ gettext-runtime/intl/log.c Wed Jan 16 23:06:10 2013
@@ -66,6 +66,7 @@ _nl_log_untranslated_locked (const char *logfilename,
{
FILE *logfile;
const char *separator;
+ size_t len;
/* Can we reuse the last opened logfile? */
if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
@@ -82,10 +83,11 @@ _nl_log_untranslated_locked (const char *logfilename,
last_logfilename = NULL;
}
/* Open the logfile. */
- last_logfilename = (char *) malloc (strlen (logfilename) + 1);
+ len = strlen (logfilename) + 1;
+ last_logfilename = (char *) malloc (len);
if (last_logfilename == NULL)
return;
- strcpy (last_logfilename, logfilename);
+ strlcpy (last_logfilename, logfilename, len);
last_logfile = fopen (logfilename, "a");
if (last_logfile == NULL)
return;