0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

1883 Commits

Author SHA1 Message Date
Ben Noordhuis
7e40c7ddc9 buffers: fix intermittent out of bounds error
The base64 decoder would intermittently throw an out-of-bounds exception when
the buffer in `buf.write('', 'base64')` was a zero-sized buffer located at the
end of the slab.

Fixes #2657.
2012-02-02 19:14:06 +01:00
Ben Noordhuis
f101f7c9ba buffers: honor length argument in base64 decoder
Honor the length argument in `buf.write(s, 0, buf.length, 'base64')`. Before
this commit, the length argument was ignored. The decoder would keep writing
until it hit the end of the buffer. Since most buffers in Node are slices of
a parent buffer (the slab), this bug would overwrite the content of adjacent
buffers.

The bug is trivially demonstrated with the following test case:

    var assert = require('assert');
    var a = Buffer(3);
    var b = Buffer('xxx');
    a.write('aaaaaaaa', 'base64');
    assert.equal(b.toString(), 'xxx');

This commit coincidentally also fixes a bug where Buffer._charsWritten was not
updated for zero length buffers.
2012-02-02 19:13:56 +01:00
isaacs
5756d7916a Now working on 0.6.10 2012-01-27 16:54:40 -08:00
isaacs
f19e20d33f 2012.01.27, Version 0.6.9 (stable)
* dgram: Bring back missing functionality for Unix (Dan VerWeire, Roman Shtylman, Ben Noordnuis)
  - Note: Windows UDP support not yet complete.

* http: Fix parser memory leak (koichik)

* zlib: Fix #2365 crashes on invalid input (Nicolas LaCasse)

* module: fix --debug-brk on symlinked scripts (Fedor Indutny)

* Documentation Restyling (Matthew Fitzsimmons)

* Update npm to 1.1.0-3 (isaacs)

* Windows: fix regression in stat() calls to C:\ (Bert Belder)
2012-01-27 16:32:19 -08:00
isaacs
ff0f0aeb40 Fix #2507 Raise errors less agressively when destroying stdio streams
Also, if an error is already provided, then raise the provided
error, rather than throwing it with a less helpful 'stdout cannot
be closed' message.

This is important for properly handling EPIPEs.
2012-01-26 17:55:44 -08:00
Ben Noordhuis
2775c0e97e dgram: bring back setTTL() 2012-01-24 00:11:45 +01:00
Ben Noordhuis
46e86aa803 dgram: bring back setMulticastLoopback() 2012-01-24 00:11:45 +01:00
Igor Zinkovsky
6c0c00a205 fix windows build 2012-01-23 01:35:11 -08:00
Ben Noordhuis
9edb984274 crypto: silence unused variable warning
`retry` is not used if SSL_PRINT_DEBUG is not defined.
2012-01-22 18:20:03 +01:00
Dan VerWeire
f2b1f57f74 dgram: reintroduce setMulticastTTL()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:26:09 +01:00
Dan VerWeire
f749338e1e dgram: reintroduce setBroadcast()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:26:04 +01:00
Roman Shtylman
a38fd6056c dgram: reintroduce addMembership() and dropMembership()
Removed during the early stages of node 0.5 refactoring to libuv.
2012-01-21 03:21:51 +01:00
isaacs
ec1d1ee61f Now working on 0.6.9 2012-01-19 21:15:12 -08:00
isaacs
d18cebaf8a 2012.01.19, Version 0.6.8 (stable)
* Update V8 to 3.6.6.19

* Numeric key hash collision fix for V8 (Erik Corry, Fedor Indutny)

* Add missing TTY key translations for F1-F5 on Windows (Brandon Benvie)

* path.extname bugfix with . and .. paths (Bert Belder)

* cluster: don't always kill the master on uncaughtException (Ben
* Noordhuis)

* Update npm to 1.1.0-2 (isaacs)

* typed arrays: set class name (Ben Noordhuis)

* zlib binding cleanup (isaacs, Bert Belder)

* dgram: use slab memory allocator (Michael Bernstein)

* fix segfault #2473
2012-01-19 18:29:43 -08:00
Ben Noordhuis
549443a7cc typed arrays: set class name
Make obj.toString and Object.prototype.toString work correctly for typed arrays.
2012-01-17 16:20:39 +01:00
mrb
bd9fa2e841 dgram: use slab memory allocator
Change udp memory allocation scheme from uv_buf_init to slab allocation. Takes
slab allocation scheme from stream_wrap.
2012-01-12 17:34:15 +01:00
Fedor Indutny
07701e7cc8 zlib: C++ style fixes 2012-01-12 01:43:49 +06:00
isaacs
8cca30f31b zlib binding cleanup
* Add assert to prevent parallel writes
* Embed request object instead of using new/delete
* Remove unnecessary WorkReqWrap in favor of uv_work_t
* Use container_of instead of req->data

Along with 2d8af39acc and
0ad2717fd8, this should Fix #2504.
2012-01-10 16:42:52 -08:00
Ben Noordhuis
0ad2717fd8 Make sure that zlib contexts are not garbage collected when busy 2012-01-10 21:01:19 +01:00
Bert Belder
2d8af39acc Fix memory leak in node_zlib 2012-01-10 21:01:18 +01:00
Ryan Dahl
e6a30bd107 Fix #2473
Tested in production.

See also http://code.google.com/p/v8/issues/detail?id=1889
2012-01-10 10:49:38 -08:00
Ben Noordhuis
b07acb3808 child_process: fix segfault after failed spawn
The process handle is uninitialized when uv_spawn() fails so don't export the
handle to JS land when that happens. Attempts to close the uninitialized handle
resulted in segmentation faults and memory corruption.

Fixes #2481.
2012-01-09 20:54:37 +01:00
Ben Noordhuis
d5d043f2d7 handle_wrap: guard against uninitialized handle or double close 2012-01-09 20:54:37 +01:00
Ben Noordhuis
9a79bb694e Avoid unnecessary buffer to string conversion.
Speeds up the benchmark below by about 680% (0.5s versus 3.4s on my Core 2 Duo).

    var crypto = require('crypto');
    var hash = crypto.createHash('sha1');
    var data = new Buffer(1024);
    for (var i = 0; i < 128 * 1024; ++i) hash.update(data);

Fixes #2494.
2012-01-09 00:50:26 +01:00
isaacs
ff4096f958 Now working on v0.6.8 2012-01-06 17:36:39 -08:00
isaacs
d5a189acef 2012.01.06, Version 0.6.7 (stable)
* V8 hash collision fix (Breaks MIPS) (Bert Belder, Erik Corry)

* Upgrade V8 to 3.6.6.15

* Upgrade npm to 1.1.0-beta-10 (isaacs)

* many doc updates (Ben Noordhuis, Jeremy Martin, koichik, Dave Irvine,
  Seong-Rak Choi, Shannen, Adam Malcontenti-Wilson, koichik)

* Fix segfault in node_http_parser.cc

* dgram, timers: fix memory leaks (Ben Noordhuis, Yoshihiro Kukuchi)

* repl: fix repl.start not passing the `ignoreUndefined` arg (Damon Oehlman)

* #1980: Socket.pause null reference when called on a closed Stream (koichik)

* #2263: XMLHttpRequest piped in a writable file stream hang (koichik)

* #2069: http resource leak (koichik)

* buffer.readInt global pollution fix (Phil Sung)

* timers: fix performance regression (Ben Noordhuis)

* #2308, #2246: node swallows openssl error on request (koichik)

* #2114: timers: remove _idleTimeout from item in .unenroll() (James Hartig)

* #2379: debugger: Request backtrace w/o refs (Fedor Indutny)

* simple DTrace ustack helper (Dave Pacheco)

* crypto: rewrite HexDecode without snprintf (Roman Shtylman)

* crypto: don't ignore DH init errors (Ben Noordhuis)
2012-01-06 16:31:03 -08:00
Ryan Dahl
be67fa7e09 Revert "crypto: add SecureContext.clearOptions() method"
API addition needs to go in master. Also openssl-0.9.8k doesn't have
SSL_CTX_clear_options().

This reverts commit 6f8839d2ac.
2012-01-06 12:01:58 -08:00
Ryan Dahl
f3da6c6c04 Potential fix for #2438
- Save StringPtr if the header hasn't been completely received yet after one
  packet.
- Add one to num_fields and num_values. They were actually one less than the
  number of fields and values.
- Remove always_inline makes debugging difficult, and has negligible
  performance benefits.
2012-01-03 17:43:39 -08:00
Ben Noordhuis
6f8839d2ac crypto: add SecureContext.clearOptions() method
SecureContext.setOptions() is backed by SSL_CTX_set_options() which, contrary to
what the name suggests, is additive: it doesn't set options, it adds them to the
already active options.

Hence the need for SecureContext.clearOptions(), which lets you unset active
options.
2012-01-02 12:02:07 +01:00
Ben Noordhuis
3f5bb15f35 dgram: fix memory leak in error path 2011-12-29 14:57:53 +01:00
Ryan Dahl
448c5e07ca Revert "Add HandleScope to http-parser binding"
This commit did not actually fix the production crashes.

This reverts commit 73cf8e82e7.
2011-12-28 14:08:19 -08:00
Ben Noordhuis
0de6ec5f08 win: fix mismatched new[]/delete 2011-12-26 03:27:28 +01:00
Ryan Dahl
73cf8e82e7 Add HandleScope to http-parser binding
Fixes production crashes. We were not able to reproduce in the test suite.
2011-12-21 12:01:41 -08:00
Ben Noordhuis
4b455bafd0 module: improve process.dlopen() error messages
On Windows, that is. On Unices, we don't have a good way to translate dlopen()
and dlsym() errors (yet).
2011-12-18 22:35:09 +01:00
Dave Pacheco
b9049d2f90 simple DTrace ustack helper 2011-12-16 11:38:20 -08:00
Roman Shtylman
4b123f9ca2 crypto: rewrite HexDecode without snprintf
No need to use snprintf to create a hex string. It creates
more overhead than is needed. This new version is much faster.
2011-12-16 14:35:15 +01:00
Ben Noordhuis
cc2861ee44 crypto: don't ignore DH init errors 2011-12-16 02:26:01 +01:00
isaacs
dd8018de95 now working on 0.6.7 2011-12-15 11:08:28 -08:00
isaacs
9a059ea69e 2011.12.14, Version 0.6.6 (stable)
* npm update to 1.1.0-beta-4 (Isaac Z. Schlueter)

* cli: fix output of --help (Ben Noordhuis)

* new website

* pause/resume semantics for stdin (Isaac Z. Schlueter)

* Travis CI integration (Maciej Małecki)

* child_process: Fix bug regarding closed stdin (Ben Noordhuis)

* Enable upgrades in MSI. (Igor Zinkovsky)

* net: Fixes memory leak (Ben Noordhuis)

* fs: handle fractional or NaN ReadStream buffer size (Ben Noordhuis)

* crypto: fix memory leaks in PBKDF2 error path (Ben Noordhuis)
2011-12-15 10:55:52 -08:00
Ben Noordhuis
ef12fa1bf7 crypto: deduplicate encoding parsing logic 2011-12-14 03:18:17 +01:00
Ben Noordhuis
321ec97d95 crypto: deduplicate decipher logic 2011-12-14 02:32:07 +01:00
Ben Noordhuis
77f21787d4 crypto: fix memory leak when decrypting empty strings
Also fixes a dangling pointer delete[] in the error path.
2011-12-13 21:22:44 +01:00
Ben Noordhuis
d70ef199f1 crypto: fix memory leaks in PBKDF2 error path 2011-12-13 18:08:18 +01:00
Ben Noordhuis
e90db17392 fs: fix typo in error message 2011-12-13 16:02:14 +01:00
Ben Noordhuis
22c2c34952 fs: fix fs.watch() segmentation fault
The binding layer failed to initialize the event string if both UV_RENAME and
UV_CHANGE were set.

Fixes #2287.
2011-12-07 23:19:57 +01:00
Ryan Dahl
7547c7df1a Deshadow, denamespace variables in node.cc
Prep for isolates.
2011-12-06 17:01:56 -08:00
Ben Noordhuis
23bb5986d4 Remove unused variable.
The file descriptor arg to child_process._forkChild() is not used any more.
Remove it, avoids future confusion.
2011-12-06 22:02:26 +01:00
isaacs
cf20b6bf65 Fix #2257 pause/resume semantics for stdin
This makes it so that the stdin TTY-wrap stream gets ref'ed on
.resume() and unref'ed on .pause()

The semantics of the names "pause" and "resume" are a bit weird, but the
important thing is that this corrects an API change from 0.4 -> 0.6
which made it impossible to read from stdin multiple times, without
knowing when it might end up being closed.  If no one has it open, this
lets the process die naturally.

LGTM'd by @ry
2011-12-05 16:47:11 -08:00
Ben Noordhuis
36815e4179 process: fix stack overflow when recursively calling process.exit() 2011-12-05 22:43:27 +01:00
Ben Noordhuis
fdf180f9ce cli: fix output of --help 2011-12-05 08:42:11 +01:00