Browse Source

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.
v0.9.1-release
Ben Noordhuis 13 years ago
parent
commit
78e831a31c
  1. 3
      src/node.cc
  2. 1
      src/node_crypto.cc
  3. 3
      src/node_extensions.cc

3
src/node.cc

@ -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)

1
src/node_crypto.cc

@ -29,7 +29,6 @@
#include <string.h>
#ifdef _MSC_VER
#define snprintf _snprintf
#define strcasecmp _stricmp
#endif

3
src/node_extensions.cc

@ -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

Loading…
Cancel
Save