Bug 24685 – std.stdio.File.rawRead allows reading raw pointers from files in @safe code
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-26T06:32:19Z
Last change time
2024-07-26T23:24:01Z
Keywords
pull
Assigned to
No Owner
Creator
elpenguino+D
Comments
Comment #0 by elpenguino+D — 2024-07-26T06:32:19Z
This compiles on everything but windows, but really really shouldn't.
```
int* foo() @safe {
int*[1] bar;
return File("example.bin", "r").rawRead(bar[])[0];
}
```
Comment #1 by dlang-bot — 2024-07-26T14:14:13Z
@ntrel created dlang/phobos pull request #9030 "Fix Bugzilla 24685 - std.stdio.File.rawRead allows reading raw pointe…" fixing this issue:
- Fix Bugzilla 24685 - std.stdio.File.rawRead allows reading raw pointers from files in @safe code
https://github.com/dlang/phobos/pull/9030
Comment #2 by dlang-bot — 2024-07-26T23:24:01Z
dlang/phobos pull request #9030 "Fix Bugzilla 24685 - std.stdio.File.rawRead allows reading raw pointe…" was merged into master:
- f01a213df1a6cbe5ca42fae4085b9f25b4e427d1 by Nick Treleaven:
Fix Bugzilla 24685 - std.stdio.File.rawRead allows reading raw pointers from files in @safe code
https://github.com/dlang/phobos/pull/9030