1. Aug 20, 2013
  2. Aug 17, 2013
    • Ben Noordhuis's avatar
      dgram: fix assertion on bad send() arguments · 0c2960ef
      Ben Noordhuis authored
      Add range checks for the offset, length and port arguments to
      dgram.Socket#send().  Fixes the following assertion:
      
          node: ../../src/udp_wrap.cc:264: static v8::Handle<v8::Value>
          node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
          `offset < Buffer::Length(buffer_obj)' failed.
      
      And:
      
          node: ../../src/udp_wrap.cc:265: static v8::Handle<v8::Value>
          node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
          `length <= Buffer::Length(buffer_obj) - offset' failed.
      
      Interestingly enough, a negative port number was accepted until now but
      silently ignored.  (In other words, it would send the datagram to a
      random port.)
      
      This commit exposed a bug in the simple/test-dgram-close test which
      has also been fixed.
      
      This is a back-port of commit 41ec6d05 from the master branch.
      
      Fixes #6025.
      0c2960ef
    • Daniel Chatfield's avatar
      readline: pause stdin before turning off terminal raw mode · 5453619e
      Daniel Chatfield authored
      On windows, libuv will immediately make a `ReadConsole` call (in the
      thread pool) when a 'flowing' `uv_tty_t` handle is switched to
      line-buffered mode. That causes an immediate issue for some users,
      since libuv can't cancel the `ReadConsole` operation on Windows 8 /
      Server 2012 and up if the program switches back to raw mode later.
      
      But even if this will be fixed in libuv at some point, it's better to
      avoid the overhead of starting work in the thread pool and immediately
      cancelling it afther that.
      
      See also f34f1e30, where the same change is made for the opposite
      flow, e.g. move `resume()` after `_setRawMode(true)`.
      
      Fixes #5927
      
      This is a backport of dfb0461c (see #5930) to the v0.10 branch.
      5453619e
    • isaacs's avatar
      blog: v0.10.16 · a66d2400
      isaacs authored
      a66d2400
    • isaacs's avatar
      Now working on v0.10.17 · 0e043528
      isaacs authored
      0e043528
    • isaacs's avatar
      Merge branch 'v0.10.16-release' into v0.10 · e679739b
      isaacs authored
      e679739b
  3. Aug 16, 2013
  4. Aug 07, 2013
  5. Aug 06, 2013
    • Eran Hammer's avatar
      stream: Fix double pipe error emit · 23d92ec8
      Eran Hammer authored
      If an error listener is added to a stream using once() before it is
      piped, it is invoked and removed during pipe() but before pipe() sees it
      which causes it to be emitted again.
      
      Fixes #4155 #4978
      23d92ec8
    • isaacs's avatar
      doc: Update LICENSE for npm's Artistic 2.0 · 366baedf
      isaacs authored
      366baedf
    • mstarzinger@chromium.org's avatar
      v8: back-port fix for CVE-2013-2882 · 6b92a713
      mstarzinger@chromium.org authored
      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.
      6b92a713
  6. Aug 05, 2013
  7. Aug 03, 2013
  8. Aug 01, 2013
    • Ben Noordhuis's avatar
      test: future-proof simple/test-event-emitter-memory-leak · 9e1eb361
      Ben Noordhuis authored
      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.
      9e1eb361
    • Ben Noordhuis's avatar
      test: fix pummel/test-net-connect-memleak · 98db7bab
      Ben Noordhuis authored
      * 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.
      98db7bab
    • Ben Noordhuis's avatar
      events: fix memory leak, don't leak event names · fc6f8a69
      Ben Noordhuis authored
      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 0397223a.
      
      Fixes #5970.
      fc6f8a69
  9. Jul 31, 2013
    • Ben Noordhuis's avatar
      http: improve chunked res.write(buf) performance · 3398cce1
      Ben Noordhuis authored
      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.
      3398cce1
    • Wyatt Preul's avatar
      docs: Warning about consuming response · 6359e017
      Wyatt Preul authored
      6359e017
  10. Jul 30, 2013
    • Ben Noordhuis's avatar
      crypto: fix assert() on malformed hex input · 6327d67b
      Ben Noordhuis authored
      Use the StringBytes::IsValidString() function introduced in commit
      dce26cce 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.
      6327d67b
    • Ben Noordhuis's avatar
      string_bytes: add StringBytes::IsValidString() · dce26cce
      Ben Noordhuis authored
      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.
      dce26cce
  11. Jul 28, 2013
  12. Jul 27, 2013
  13. Jul 25, 2013
    • Ben Noordhuis's avatar
      test: fix simple/test-setproctitle · e4363145
      Ben Noordhuis authored
      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.
      e4363145
  14. Jul 26, 2013