aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/inet_gethost.c
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-05-04 09:08:11 +0000
committerErlang/OTP <[email protected]>2010-05-04 09:08:11 +0000
commit7b36be0a4009af102aeead5d6d97e7822cb6ce2f (patch)
tree43bbbd5e0a32b3a0e2829c14a1cfac86ea54da36 /erts/etc/common/inet_gethost.c
parent33e2df7148957f2be1cb12f0302ac80034b8ad22 (diff)
parentd1b44cb27a59e45386f57e51f352dba0a3735a76 (diff)
downloadotp-7b36be0a4009af102aeead5d6d97e7822cb6ce2f.tar.gz
otp-7b36be0a4009af102aeead5d6d97e7822cb6ce2f.tar.bz2
otp-7b36be0a4009af102aeead5d6d97e7822cb6ce2f.zip
Merge branch 'ms/inet_gethost-safe-debug-output' into dev
* ms/inet_gethost-safe-debug-output: Truncate debug messages OTP-8615 ms/inet_gethost-safe-debug-output
Diffstat (limited to 'erts/etc/common/inet_gethost.c')
-rw-r--r--erts/etc/common/inet_gethost.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index ff16ee02c4..d3ff4874ac 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ *
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
/*
@@ -52,6 +52,8 @@
# include "config.h"
#endif
+#include "erl_printf.h"
+
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
@@ -2552,7 +2554,7 @@ static void debugf(char *format, ...)
sprintf(buff,"%s[%d] (DEBUG):",program_name,(int) getpid());
#endif
ptr = buff + strlen(buff);
- vsprintf(ptr,format,ap);
+ erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
strcat(ptr,"\r\n");
#ifdef WIN32
if (debug_console_allocated != INVALID_HANDLE_VALUE) {
@@ -2574,7 +2576,7 @@ static void warning(char *format, ...)
va_start(ap,format);
sprintf(buff,"%s[%d]: WARNING:",program_name, (int) getpid());
ptr = buff + strlen(buff);
- vsprintf(ptr,format,ap);
+ erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
strcat(ptr,"\r\n");
#ifdef WIN32
{
@@ -2596,7 +2598,7 @@ static void fatal(char *format, ...)
va_start(ap,format);
sprintf(buff,"%s[%d]: FATAL ERROR:",program_name, (int) getpid());
ptr = buff + strlen(buff);
- vsprintf(ptr,format,ap);
+ erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
strcat(ptr,"\r\n");
#ifdef WIN32
{