Permalink
Browse files

Don't use _snprintf() on Windows, it's not safe.

_snprintf() doesn't zero-terminate the buffer on overflow. Use the hand-rolled
version that lives in src/node_internals.h.
  • Loading branch information...
1 parent 1eb9fc5 commit 78e831a31c0ad31156457c7068726e3c0e93b266 @bnoordhuis bnoordhuis committed May 8, 2012
Showing with 0 additions and 7 deletions.
  1. +0 −3 src/node.cc
  2. +0 −1 src/node_crypto.cc
  3. +0 −3 src/node_extensions.cc
View
@@ -31,9 +31,6 @@
#include <locale.h>
#include <signal.h>
#include <stdio.h>
-#if defined(_MSC_VER)
-#define snprintf _snprintf
-#endif
#include <stdlib.h>
#include <string.h>
#if !defined(_MSC_VER)
View
@@ -29,7 +29,6 @@
#include <string.h>
#ifdef _MSC_VER
-#define snprintf _snprintf
#define strcasecmp _stricmp
#endif
View
@@ -24,9 +24,6 @@
#include "node_version.h"
#include <string.h>
#include <stdio.h>
-#if defined(_MSC_VER)
-#define snprintf _snprintf
-#endif
#undef NODE_EXT_LIST_START
#undef NODE_EXT_LIST_ITEM

0 comments on commit 78e831a

Please sign in to comment.