ringabout
1f07fdd2dc
fixes #24664 ; always sets the \0 terminator in appendString ( #24703 )
...
fixes #24664
```nim
proc main() =
for i in 0..1:
var s = "12345"
s.add s
echo s
main()
```
In the given example, `add` contains two steps: `prepareAdd` and
`appendString`. In the first step, a new buffer is created in order to
store the final doubled string. But it doesn't copy the null terminator,
neither zeromem the left unused spaces. It causes a problem because
`appendString` will copy itself which doesn't end with `\0` properly so
contaminated memory is copied instead.
```
var s = 12345\0
prepareAdd:
var s = 12345xxxxx\0
appendString:
var s = 1234512345x
```
2025-02-19 23:01:56 +01:00
..
2023-09-09 21:11:45 +02:00
2024-12-04 18:28:13 +08:00
2025-01-02 17:28:35 +01:00
2025-02-18 17:24:41 +01:00
2024-09-17 21:28:54 +02:00
2023-04-04 12:18:43 +02:00
2017-01-31 13:08:47 +01:00
2022-09-28 15:28:45 -04:00
2022-12-01 13:34:00 +01:00
2024-10-07 23:18:11 +02:00
2024-10-07 23:18:11 +02:00
2024-10-07 23:18:11 +02:00
2023-10-11 17:44:14 +02:00
2024-12-06 05:40:48 +01:00
2024-12-13 15:04:49 +01:00
2024-07-26 20:45:52 +02:00
2024-12-13 15:04:49 +01:00
2021-05-01 11:10:40 +02:00
2022-04-07 17:38:01 -04:00
2023-04-11 21:20:20 +02:00
2022-11-09 16:22:55 +01:00
2024-12-04 18:28:13 +08:00
2024-12-04 18:28:13 +08:00
2024-10-08 21:50:35 +02:00
2024-01-27 07:57:07 +01:00
2022-09-28 15:28:45 -04:00
2024-02-21 16:58:30 +01:00
2023-11-06 07:57:29 +01:00
2022-08-24 13:38:30 +02:00
2023-03-22 22:05:20 +01:00
2022-11-05 10:58:57 +01:00
2020-05-12 15:46:24 +02:00
2023-10-30 17:03:04 +01:00
2022-10-29 18:11:40 +02:00
2023-10-30 17:03:04 +01:00
2024-08-28 20:46:36 +02:00
2022-12-26 13:20:05 +01:00
2021-08-13 09:35:48 +02:00
2024-08-01 12:27:10 +08:00
2024-12-04 18:28:13 +08:00
2023-10-11 17:18:54 +02:00
2023-11-04 08:52:30 +01:00
2024-10-19 10:07:00 +02:00
2024-12-04 18:28:13 +08:00
2023-10-11 17:44:14 +02:00
2022-11-05 10:58:57 +01:00
2022-11-05 10:58:57 +01:00
2024-08-11 10:35:09 +08:00
2024-12-04 18:28:13 +08:00
2023-08-08 05:55:18 -04:00
2022-12-01 12:48:47 +08:00
2022-10-11 09:17:09 +02:00
2024-11-21 22:10:26 +01:00
2021-08-13 09:35:48 +02:00
2024-12-13 15:04:49 +01:00
2024-02-20 07:28:45 +01:00
2024-07-26 20:45:52 +02:00
2020-10-19 14:50:06 +02:00
2025-01-19 16:20:54 +03:00
2023-04-17 20:55:22 +02:00
2023-08-15 23:31:44 +02:00
2022-10-11 09:17:09 +02:00
2024-12-04 18:28:13 +08:00
2025-02-19 23:01:56 +01:00
2024-10-07 23:18:11 +02:00
2021-11-11 19:07:08 +01:00
2024-11-23 22:01:39 +01:00
2024-12-04 18:28:13 +08:00
2020-01-30 10:54:50 +01:00