[NTOS:IO] Fix basicInfo handling in IopGetDriverNames().
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 10 Jun 2021 20:31:45 +0000 (22:31 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 16 Jun 2021 20:18:02 +0000 (22:18 +0200)
commite09d1dec7ae938e27ca3013d2ffefae6bf78d230
treebdecc7ad606c5d1d106a99e594bea1cc5c47fe3c
parent0d28f271565c5ec3e04b6277d83dd6b341e680eb
[NTOS:IO] Fix basicInfo handling in IopGetDriverNames().

- Fix CID 1477246: Uninitialized pointer read (UNINIT) (happens in
  the last ExFreePoolWithTag(basicInfo, TAG_IO) call when the
  "(!NT_SUCCESS(status) || ServiceName != NULL)" case is not taken).

- Centralize all the ExFreePoolWithTag(basicInfo, TAG_IO) cleanups
  at the end of the function.

- Both cases "(driverName.Buffer == NULL)" and "(ServiceName != NULL)"
  can only be taken when basicInfo != NULL, so assert on this fact.
ntoskrnl/io/iomgr/driver.c