/*
* Copyright (c) 1995 RadioMail Corporation.
- * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Internet Systems Consortium, Inc.
- * 950 Charter Street
- * Redwood City, CA 94063
+ * PO Box 360
+ * Newmarket, NH 03857 USA
* <info@isc.org>
* https://www.isc.org/
*
{
va_list list;
- do_percentm (fbuf, fmt);
+ do_percentm (fbuf, sizeof fbuf, fmt);
/* %Audit% This is log output. %2004.06.17,Safe%
* If we truncate we hope the user can get a hint from the log.
{
va_list list;
- do_percentm (fbuf, fmt);
+ do_percentm (fbuf, sizeof fbuf, fmt);
/* %Audit% This is log output. %2004.06.17,Safe%
* If we truncate we hope the user can get a hint from the log.
{
va_list list;
- do_percentm (fbuf, fmt);
+ do_percentm (fbuf, sizeof fbuf, fmt);
/* %Audit% This is log output. %2004.06.17,Safe%
* If we truncate we hope the user can get a hint from the log.
{
va_list list;
- do_percentm (fbuf, fmt);
+ do_percentm (fbuf, sizeof fbuf, fmt);
/* %Audit% This is log output. %2004.06.17,Safe%
* If we truncate we hope the user can get a hint from the log.
/* Find %m in the input string and substitute an error message string. */
-void do_percentm (obuf, ibuf)
+void do_percentm (obuf, obufsize, ibuf)
char *obuf;
+ size_t obufsize;
const char *ibuf;
{
const char *s = ibuf;
if (!m)
m = "<unknown error>";
len += strlen (m);
- if (len > CVT_BUF_MAX)
+ if (len > obufsize - 1)
goto out;
strcpy (p - 1, m);
p += strlen (p);
++s;
} else {
- if (++len > CVT_BUF_MAX)
+ if (++len > obufsize - 1)
goto out;
*p++ = *s++;
}
} else {
if (*s == '%')
infmt = 1;
- if (++len > CVT_BUF_MAX)
+ if (++len > obufsize - 1)
goto out;
*p++ = *s++;
}