-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 13367 - Buffer overflow when setting PATH #2459
Fix Issue 13367 - Buffer overflow when setting PATH #2459
Conversation
|
So yes, I failed to copy-paste-modify code from my allocators to the pull and reviewers failed to see the mistake. |
|
This tells me, aside from the fact that I must be blind, that there has to be more tests. For instance this fails for me consistently, with any length: UPDATE: fixed a typo, LOL. |
The test is incorrect. It should call |
|
@denis-sh That's better. Now the following hits access violation with old version. I guess it would work with your patch. |
|
Wouldn't it make more sense to have default character type to be that of passed string unless explicitly provided? |
C function is generally not templated, so API is designed with this case in mind: void setEnvironment(C)(in C[] name, in C[] value)
if(isSomeChar!C)
{ enforce(setenv(name.tempCString(), value.tempCString(), 1) != -1); } |
|
Makes sense. Then please integrate tests for this bug and it should be ready to go. |
Fixup for pull dlang#2332.
9fff246 to
46d0e01
Compare
|
Added unittest for the issue. |
|
Auto-merge toggled on |
Fix Issue 13367 - Buffer overflow when setting PATH
|
Thanks! |
https://issues.dlang.org/show_bug.cgi?id=13367
Fixup for pull #2332.