Skip to content

Commit

Permalink
fix use after free in fake methods
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan committed Apr 15, 2024
1 parent b042f1f commit 96ad8de
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/requests.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,17 @@ notification_did_save :: proc(
for k2, v2 in &v.symbols {
if corrected_uri.uri == v2.uri {
free_symbol(v2, indexer.index.collection.allocator)
v.symbols[k2] = {}
delete_key(&v.symbols, k2)
}
}

for method, &symbols in v.methods {
for i := 0; i < len(symbols); i += 1 {
#no_bounds_check symbol := symbols[i]
if corrected_uri.uri == symbol.uri {
unordered_remove(&symbols, i)
i -= 1
}
}
}
}
Expand Down

0 comments on commit 96ad8de

Please sign in to comment.