| author | |
| committer | |
| log | 65cad8ab1398667bdc401cbdfaabfcd9cc8459d8 |
| tree | ea15fa648a9bfd7e5d6c7371c85600eaa16614ee |
| parent | 45b62c4529ee76f0bb6e948626a7fa6a8024e243 |
The current code wrongly assumes that versions[0] will always exist after the iterateAndFilterByVersion call.1 files changed, 1 insertions(+), 0 deletions(-)
lib/std/zig/WindowsSdk.zig+1| ... | ... | @@ -476,6 +476,7 @@ pub const Installation = struct { |
| 476 | 476 | |
| 477 | 477 | var iterator = sdk_lib_dir.iterate(); |
| 478 | 478 | const versions = try iterateAndFilterByVersion(&iterator, allocator, prefix); |
| 479 | if (versions.len == 0) return error.InstallationNotFound; | |
| 479 | 480 | defer { |
| 480 | 481 | for (versions[1..]) |version| allocator.free(version); |
| 481 | 482 | allocator.free(versions); |