NullReferenceException accessing out of bounds gac_paths #658

Closed
opened 2020-03-31 17:17:37 -05:00 by vvuk · 2 comments
vvuk commented 2020-03-31 17:17:37 -05:00 (Migrated from github.com)

https://github.com/jbevain/cecil/blob/master/Mono.Cecil/BaseAssemblyResolver.cs#L369 hardcodes "2" as the number of entries in gac_paths, but if you're doing something as dumb as I'm doing, in GetGacPaths here https://github.com/jbevain/cecil/blob/master/Mono.Cecil/BaseAssemblyResolver.cs#L291 if you're not on mono AND you don't have the WINDIR env var, you'll end up with an empty gac paths collection and blow up in the lookup.

https://github.com/jbevain/cecil/blob/master/Mono.Cecil/BaseAssemblyResolver.cs#L369 hardcodes "2" as the number of entries in `gac_paths`, but if you're doing something as dumb as I'm doing, in `GetGacPaths` here https://github.com/jbevain/cecil/blob/master/Mono.Cecil/BaseAssemblyResolver.cs#L291 if you're not on mono AND you don't have the `WINDIR` env var, you'll end up with an empty gac paths collection and blow up in the lookup.
jbevain commented 2020-03-31 17:27:05 -05:00 (Migrated from github.com)

SHAME. SHAME. SHAME. 🔔

SHAME. SHAME. SHAME. 🔔
vvuk commented 2020-03-31 17:36:53 -05:00 (Migrated from github.com)

I know you don't mean that for me, but if you knew what I was doing, you would

I know you don't mean that for _me_, but if you knew what I was doing, you _would_
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil#658
No description provided.