[phobos] [D-Programming-Language/phobos] 6392e8: Fix possible stack corruption in std.net.curl

GitHub noreply at github.com
Sun Dec 15 13:51:37 PST 2013


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 6392e8af36f78919971504e5e8f4a61170b3e5a1
      https://github.com/D-Programming-Language/phobos/commit/6392e8af36f78919971504e5e8f4a61170b3e5a1
  Author: Johannes Pfau <johannespfau at gmail.com>
  Date:   2013-12-07 (Sat, 07 Dec 2013)

  Changed paths:
    M std/net/curl.d

  Log Message:
  -----------
  Fix possible stack corruption in std.net.curl

The HTTP and SMTP structs are used as value types. The delegate created
in onReceiveHeader stores a pointer to this HTTP as it needs to access
this.p so we potentially leak a reference to a stack variable here.

As the Impl struct is always allocated on the heap via RefCounted
storing a pointer to Impl is not an issue. So we move the delegate
generation out of HTTP and into impl to make sure it only stores a
pointer to Impl which will stay valid even if the original HTTP object
is moved.

Also reset some delegates in _basicHTTP and _basicFTP to avoid leaving
references to stack variables around.


  Commit: 39652cbd707030c76dcfb9677212597f486098fc
      https://github.com/D-Programming-Language/phobos/commit/39652cbd707030c76dcfb9677212597f486098fc
  Author: Martin Nowak <code at dawg.eu>
  Date:   2013-12-15 (Sun, 15 Dec 2013)

  Changed paths:
    M std/net/curl.d

  Log Message:
  -----------
  Merge pull request #1757 from jpf91/fixCurl

[urgent] Fix possible stack corruption in std.net.curl


Compare: https://github.com/D-Programming-Language/phobos/compare/cd22d66b1cfb...39652cbd7070


More information about the phobos mailing list