{"push_id":827520587,"size":1,"distinct_size":0,"ref":"refs/heads/km/cache-entry-refcnt","head":"62fd51a9eba5609008fadb8cc4cf71835e6c5830","before":"5aa35e23fc4f92dba14d69b1956e211d489d5df8","commits":[{"sha":"62fd51a9eba5609008fadb8cc4cf71835e6c5830","author":{"email":"94a47f49ad15a3b0de27514399750eb8277a3525@twitter.com","name":"Keith McGuigan"},"message":"merge: fix cache_entry use-after-free\n\nDuring merges, we would previously free entries that we no longer need\nin the destination index.  But those entries might also be stored in\nthe dir_entry cache, and when a later call to add_to_index found them,\nthey would be used after being freed.\n\nTo prevent this, add a ref count for struct cache_entry.  Whenever\na cache entry is added to a data structure, the ref count is incremented;\nwhen it is removed from the data structure, it is decremented.  When\nit hits zero, the cache_entry is freed.\n\nSigned-off-by: Keith McGuigan <kmcguigan@twitter.com>\nSigned-off-by: David Turner <dturner@twopensource.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/gitster/git/commits/62fd51a9eba5609008fadb8cc4cf71835e6c5830"}]}