Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Don't use _snprintf() on Windows, it's not safe.
Browse files Browse the repository at this point in the history
_snprintf() doesn't zero-terminate the buffer on overflow. Use the hand-rolled
version that lives in src/node_internals.h.
  • Loading branch information
bnoordhuis committed May 8, 2012
1 parent 1eb9fc5 commit 78e831a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/node.cc
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/node_crypto.cc
Expand Up @@ -29,7 +29,6 @@

#include <string.h>
#ifdef _MSC_VER
#define snprintf _snprintf
#define strcasecmp _stricmp
#endif

Expand Down
3 changes: 0 additions & 3 deletions src/node_extensions.cc
Expand Up @@ -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
Expand Down

0 comments on commit 78e831a

Please sign in to comment.