]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
Fix BSOD on shutdown due to freeing NULL pointer
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 2 Oct 2017 10:07:45 +0000 (11:07 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 2 Oct 2017 10:07:45 +0000 (11:07 +0100)
Unfortunately ExFreePoolWithTag() is not NULL-safe, and Base64Free() is
coded assuming it is. This patch adds an extra check for NULL to fix the
problem.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvbd/base64.c

index 3e79b9fad4be7da182a71ec10f9be47c071aa17c..0e62784e4e5c340a8463790a7ef5bfa396219948 100644 (file)
@@ -60,7 +60,8 @@ Base64Free(
     IN  PVOID   Buffer
     )
 {
-    ExFreePoolWithTag(Buffer, BASE64_POOL_TAG);
+    if (Buffer)
+        ExFreePoolWithTag(Buffer, BASE64_POOL_TAG);
 }
 
 static FORCEINLINE UCHAR