1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-ak,v 1.3 2009/12/23 13:27:59 drochner Exp $
--- base/gsmisc.c.orig 2009-12-23 12:29:51.000000000 +0000
+++ base/gsmisc.c
@@ -69,7 +69,7 @@ int outprintf(const gs_memory_t *mem, co
va_start(args, fmt);
- count = vsprintf(buf, fmt, args);
+ count = vsnprintf(buf, sizeof(buf), fmt, args);
outwrite(mem, buf, count);
if (count >= PRINTF_BUF_LENGTH) {
count = sprintf(buf,
@@ -89,7 +89,7 @@ int errprintf(const char *fmt, ...)
va_start(args, fmt);
- count = vsprintf(buf, fmt, args);
+ count = vsnprintf(buf, sizeof(buf), fmt, args);
errwrite(buf, count);
if (count >= PRINTF_BUF_LENGTH) {
count = sprintf(buf,
@@ -236,7 +236,7 @@ int gs_throw_imp(const char *func, const
va_list ap;
va_start(ap, fmt);
- vsprintf(msg, fmt, ap);
+ vsnprintf(msg, sizeof(msg), fmt, ap);
msg[sizeof(msg) - 1] = 0;
va_end(ap);
|