www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14137] New: std.socket.getAddressInfo breaks safety

https://issues.dlang.org/show_bug.cgi?id=14137

          Issue ID: 14137
           Summary: std.socket.getAddressInfo breaks  safety
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: safe
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: code klickverbot.at

---
struct Oops {
    const(char[]) convert() {
        *cast(int*)0xcafebabe = 0xdeadbeef;
        return null;
    }
    alias convert this;
}

void main()  safe {
    import std.socket;
    getAddressInfo("", Oops.init);
}
---

Seems to be Git master (to-be 2.067) only.

Source permalink:
https://github.com/D-Programming-Language/phobos/blob/master/std/socket.d#L996-L997

Introduced in https://github.com/D-Programming-Language/phobos/pull/2316.

--
Feb 06 2015