Thread overview
[Issue 24458] Mac M3 associative array keys on std.net.curl gets overwritten
Mar 27
Dlang Bot
Mar 31
Dlang Bot
March 27
https://issues.dlang.org/show_bug.cgi?id=24458

--- Comment #1 from Marcelo Silva Nascimento Mancini <msnmancini@hotmail.com> ---
I got that printed btw:
```
["\r\n\0tent":"S1711554434.755792,VS0,VE506",
"\r\n\0t":"\"0x8DBF529351DA33D\"", "\r\n\0tent-length: 15":"Tue, 05 Dec 2023
00:29:13 GMT", "\r\n\0tent-len":"cache-iad-kcgs7200155-IAD,
cache-gru-sbgr1930059-GRU", "\r\n\0tent-leng":"0, 0", "\r\n\0tent-length:
":"available", "\r\n\0tent-leng":"2020-10-02", "\r\n\0tent-length":"BlockBlob",
"\r\n\0tent-length:":"38677530-b01e-004d-515d-802eb9000000", "\r\n\0":"1.1
varnish, 1.1 varnish", "\r\n\0tent-len":"PmPmV2w5qfhV/9imSY2qNg==",
"\r\n\0tent":"MISS, HIT", "\r\n\0tent-length: 150":"attachment;
filename=ldc2-1.36.0-beta1-osx-universal.tar.xz", "\r\n\0t":"Wed, 27 Mar 2024
15:47:14 GMT", "\r\n\0ten":"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"\r\n\0tent-length":"150538836", "\r\n\0tent-length: 1":"unlocked",
"\r\n\0":"384", "\r\n\0tent-lengt":"bytes", "\r\n\0tent-length: 15053":"true",
"\r\n\0tent-lengt":"Tue, 05 Dec 2023 00:29:13 GMT",
"\r\n\0tent-leng":"application/octet-stream"]

```

--
March 27
https://issues.dlang.org/show_bug.cgi?id=24458

Steven Schveighoffer <schveiguy@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@gmail.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=2954

--- Comment #2 from Steven Schveighoffer <schveiguy@gmail.com> ---
Note that the root cause here is the use of `toLower` on the header key. Since `toLower` will avoid allocating a new array if the input is already lower case, the slice of the original curl buffer is returned (if e.g. it's `content-type` instead of `Content-type`). This means you store a slice to a reusable buffer from curl as the string key.

For the reason why this is allowed, when `const(char)[]` does not convert to `string`, see issue 2954.

--
March 27
https://issues.dlang.org/show_bug.cgi?id=24458

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@MrcSnm updated dlang/phobos pull request #8961 "Fix Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten" fixing this issue:

- Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten

https://github.com/dlang/phobos/pull/8961

--
March 31
https://issues.dlang.org/show_bug.cgi?id=24458

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #8961 "Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets overwritten" was merged into stable:

- afb0b3485b918e97caff0476f2e60e1d936aafeb by MrcSnm:
  Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets
overwritten

- 4d332baad1a053d8aa67ff3cff80f7787182cbe7 by MrcSnm:
  Fix Bugzilla Issue 24458 - Mac M3 associative array keys on std.net.curl gets
overwritten

https://github.com/dlang/phobos/pull/8961

--