Commit Graph

8803 Commits (1285008fcaa4edc2f810577b42a37cf96696cdf4)

Author SHA1 Message Date
mstarzinger@chromium.org 6b92a71321 v8: back-port fix for CVE-2013-2882
Quoting the CVE:

    Google V8, as used in Google Chrome before 28.0.1500.95, allows
    remote attackers to cause a denial of service or possibly have
    unspecified other impact via vectors that leverage "type confusion."

Likely has zero impact on node.js because it only runs local, trusted
code but let's apply it anyway.

This is a back-port of upstream commit r15665. Original commit log:

    Use internal array as API function cache.

    R=yangguo@chromium.org
    BUG=chromium:260106
    TEST=cctest/test-api/Regress260106

    Review URL: https://codereview.chromium.org/19159003

Fixes #5973.
2013-08-05 18:17:24 +02:00
Forrest L Norvell 231092d236 doc: document domain.enter() and domain.exit()
Adds the documentation requested in #5017.
2013-08-05 13:11:38 +02:00
Sam Roberts 6a7be99703 doc: fs.open, fix flag/mode confusion, etc.
Flags and modes aren't the same, symlinks are followed in all of the
path but the last component, docs should say something about what the
mode argument is for and when its used, fs.openSync should point to the
function that contains the docs for its args, as fs.writeSync does.
2013-08-05 12:26:09 +02:00
isaacs bea9dfa14c npm: Upgrade to 1.3.7 2013-08-02 14:55:22 -07:00
Ben Noordhuis 9e1eb361e8 test: future-proof simple/test-event-emitter-memory-leak
Run the garbage collector before running the actual test. It doesn't
matter now but if in the future something in node.js core creates a lot
of reclaimable garbage, that will break the test's expectation.
2013-08-01 16:14:14 +02:00
Ben Noordhuis 98db7babcc test: fix pummel/test-net-connect-memleak
* Run the garbage collector before creating the big array. It doesn't
  matter now but if in the future something in node.js core creates
  a lot of reclaimable garbage, that will break the test's expectation.

* The first RSS check was being done too late. The garbage collector
  might have run before the check, throwing off the 'reclaimed memory'
  calculation.

* Due to changes in how V8 represents the big array internally, the
  actual memory usage is just below 256 MB on x64. Update the test's
  expectation.
2013-08-01 16:07:46 +02:00
Ben Noordhuis fc6f8a6943 events: fix memory leak, don't leak event names
Before this commit, events were set to undefined rather than deleted
from the EventEmitter's backing dictionary for performance reasons:
`delete obj.key` causes a transition of the dictionary's hidden class
and that can be costly.

Unfortunately, that introduces a memory leak when many events are added
and then removed again. The strings containing the event names are never
reclaimed by the garbage collector because they remain part of the
dictionary.

That's why this commit makes EventEmitter delete events again. This
effectively reverts commit 0397223.

Fixes #5970.
2013-08-01 14:52:06 +02:00
Ben Noordhuis 3398cce193 http: improve chunked res.write(buf) performance
Avoid a costly buffer-to-string operation. Instead, allocate a new
buffer, copy the chunk header and data into it and send that.

The speed difference is negligible on small payloads but it really
shines with larger (10+ kB) chunks. benchmark/http/end-vs-write-end
with 64 kB chunks gives 45-50% higher throughput. With 1 MB chunks,
the difference is a staggering 590%.

Of course, YMMV will vary with real workloads and networks but this
commit should have a positive impact on CPU and memory consumption.

Big kudos to Wyatt Preul (@wpreul) for reporting the issue and providing
the initial patch.

Fixes #5941 and #5944.
2013-07-31 13:23:06 +02:00
Wyatt Preul 6359e017ac docs: Warning about consuming response 2013-07-30 15:06:20 -07:00
Ben Noordhuis 6327d67be3 crypto: fix assert() on malformed hex input
Use the StringBytes::IsValidString() function introduced in commit
dce26cc to ensure that the input string meets the expectations of the
other StringBytes functions before processing it further.

Fixes the following assertion:

    Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
    length"), function StorageSize, file ../../src/string_bytes.cc,
    line 301.

Fixes #5725.
2013-07-30 14:34:19 +02:00
Ben Noordhuis dce26ccea1 string_bytes: add StringBytes::IsValidString()
Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.
2013-07-30 14:32:47 +02:00
Ben Noordhuis 4881a6a9a3 doc: clarify fs.read() offset argument 2013-07-28 00:05:10 +02:00
Andrew Chilton 767c5bf01d doc: add nodejs.geek.nz to the community page 2013-07-27 16:02:05 +02:00
Rod Vagg df1673202c doc: add nodejs.org.au to community listing 2013-07-27 12:25:59 +02:00
Ben Noordhuis e4363145ba test: fix simple/test-setproctitle
The title shouldn't be too long; libuv's uv_set_process_title() out of
security considerations no longer overwrites envp, only argv, so the
maximum title length is possibly quite short.

Fixes #5908.
2013-07-25 12:29:20 +02:00
Timothy J Fontaine 180f987147 blog: Post for v0.10.15 2013-07-25 17:03:21 -07:00
Timothy J Fontaine 33267337fa Now working on 0.10.16 2013-07-25 17:03:03 -07:00
Timothy J Fontaine 272525714d Merge branch 'v0.10.15-release' into v0.10 2013-07-25 17:02:38 -07:00
Timothy J Fontaine 2426d65af8 2013.07.25, Version 0.10.15 (Stable)
* src: fix process.getuid() return value (Ben Noordhuis)
2013-07-25 16:26:15 -07:00
Ben Noordhuis 015ec05272 src: fix process.getuid() return value
And process.getgid() too.

Commit ed80638 changed fs.chown() and fs.fchown() to only accept
unsigned integers. Make process.getuid() and process.getgid() follow
suit.

This commit should unbreak npm on OS X - it's hitting the new 'uid must
be an unsigned int' check when installing as e.g. user 'nobody' (which
has an UID of -2 in /etc/passwd or 4294967294 when cast to an uid_t.)

Fixes #5904.
2013-07-26 00:29:03 +02:00
Ben Noordhuis 0de5b831e2 doc: document tls.Server 'secureProtocol' option 2013-07-25 23:21:54 +02:00
Timothy J Fontaine 0256edc43e blog: Post for v0.10.14 2013-07-25 13:54:55 -07:00
Timothy J Fontaine 90c448de23 Now working on 0.10.15 2013-07-25 13:54:16 -07:00
Timothy J Fontaine e2a598b5f2 Merge branch 'v0.10.14-release' into v0.10 2013-07-25 13:53:45 -07:00
Timothy J Fontaine fdf57f811f 2013.07.25, Version 0.10.14 (Stable)
* uv: Upgrade to v0.10.13

* npm: Upgrade to v1.3.5

* os: Don't report negative times in cpu info (Ben Noordhuis)

* fs: Handle large UID and GID (Ben Noordhuis)

* url: Fix edge-case when protocol is non-lowercase (Shuan Wang)

* doc: Streams API Doc Rewrite (isaacs)

* node: call MakeDomainCallback in all domain cases (Trevor Norris)

* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
2013-07-25 11:49:01 -07:00
Timothy J Fontaine 5c81f41e70 uv: Upgrade to v0.10.13 2013-07-25 10:48:29 -07:00
isaacs 4bf5211820 doc: explicitly set industry logo height 2013-07-24 13:37:20 -07:00
isaacs ff0de45929 npm: Upgrade to v1.3.5 2013-07-24 13:23:44 -07:00
Ben Noordhuis e20811a628 src: os: use Number::New() for CPU info
The return values from uv_cpu_info() don't necessarily fit in a 32 bits
signed integer.

Fixes #5732.
2013-07-23 17:12:17 +02:00
Ben Noordhuis ed806385bf fs: uids and gids must be unsigned ints
Before this commit, fs.chown() and fs.fchown() coerced the uid and gid
arguments to signed integers which is wrong because uid_t and gid_t are
unsigned on most all platforms and IDs that don't fit in a signed
integer do exist.

This commit changes the aforementioned functions to take unsigned ints
instead.  No test because we can't assume the system has [GU]IDs that
large.

This change depends on joyent/libuv@d779eb5.

Fixes #5890.
2013-07-23 13:36:46 +02:00
Ben Noordhuis 14f45ba739 test: move two tests from simple/ to internet/
Fixes #5876.
2013-07-20 12:36:33 +02:00
Ben Noordhuis e0c4fba0ac doc: events: clarify 'newListener' emitter state
Ditto for the 'removeListener' event.
2013-07-18 20:49:24 +02:00
Shuan Wang 48a4600c56 url: Fix edge-case when protocol is non-lowercase
When using url.parse(), path and pathname usually return '/' when there
is no path available. However when you have a protocol that contains
non-lowercase letters and the input string does not have a trailing
slash, both path and pathname will be undefined.
2013-07-17 15:59:28 -07:00
isaacs 04e0324f6a doc: style the 'type' fields in API docs 2013-07-16 10:49:54 -07:00
isaacs db5776cf8b doc: Streams API Doc Rewrite
The Streams API doc is now broken up into 3 sections:

1. API for Consumers
2. API for Implementors
3. Details and Extras

This addresses one of the biggest points of confusion for new users who
start to consume streams, and get the impression that they have to do
lots of extra work and implement classes and such, just to get some data
out of a file.
2013-07-16 10:49:54 -07:00
isaacs e48536f4cd tls: Trivial use_strict fix 2013-07-14 20:08:07 -07:00
Timothy J Fontaine 875dd37a93 blog: v0.11.4 is unstable not stable 2013-07-12 17:05:53 -07:00
Timothy J Fontaine 21dd5f4ea9 blog: v0.11.4 release 2013-07-12 15:12:49 -07:00
isaacs 5e86519199 npm: Upgrade to 1.3.4 2013-07-12 13:14:50 -07:00
isaacs ff8a4058bf npm: Upgrade to 1.3.3 2013-07-12 08:56:26 -07:00
Trevor Norris 6d91bd3707 node: call MakeDomainCallback in all domain cases
Previously there was no way to pass a Function callback directly to
MakeCallback and support domains. The check has been added so that users
never have to worry about supporting domains while using MakeCallback.
2013-07-10 10:46:48 -07:00
Fedor Indutny 610269295b crypto: fix memory leak in LoadPKCS12
X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.

This is a back-port of commit c1db1ec from the master branch.
2013-07-10 10:10:29 +02:00
Ben Noordhuis 8a65df9baa test: fix up indentation, replace tabs with spaces 2013-07-10 09:48:57 +02:00
isaacs b3b8e74dbf tools: Add next/prev version scripts 2013-07-09 15:58:15 -07:00
Timothy J Fontaine f1bb5dca85 blog: Post for v0.10.13 2013-07-09 14:29:16 -07:00
Timothy J Fontaine 8a7e2b9da6 Now working v0.10.14 2013-07-09 14:28:37 -07:00
Timothy J Fontaine 8d9897d735 Merge branch 'v0.10.13-release' into v0.10 2013-07-09 14:28:05 -07:00
Timothy J Fontaine e32660a984 2013.07.09, Version 0.10.13 (Stable)
* uv: Upgrade to v0.10.12

* npm: Upgrade to 1.3.2

* windows: get proper errno (Ben Noordhuis)

* tls: only wait for finish if we haven't seen it (Timothy J Fontaine)

* http: Dump response when request is aborted (isaacs)

* http: use an unref'd timer to fix delay in exit (Peter Rust)

* zlib: level can be negative (Brian White)

* zlib: allow zero values for level and strategy (Brian White)

* buffer: add comment explaining buffer alignment (Ben Noordhuis)

* string_bytes: properly detect 64bit (Timothy J Fontaine)

* src: fix memory leak in UsingDomains() (Ben Noordhuis)
2013-07-09 13:51:24 -07:00
Timothy J Fontaine 5b6464f461 build: use separate env vars for signing 2013-07-09 13:50:45 -07:00
isaacs 8bac8857f5 uv: Upgrade to v0.10.12 2013-07-09 13:20:38 -07:00